Skip to content

Fix pydantic field documentation for List/Set/Tuple #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2021

Conversation

shashankrnr32
Copy link
Contributor

@shashankrnr32 shashankrnr32 commented Feb 20, 2021

Fixes #94

Note that I have tested this for these types
List, Set, Tuple, Union

Update on why Optional isn't working: This explains it

@shashankrnr32 shashankrnr32 marked this pull request as draft February 20, 2021 05:28
@shashankrnr32 shashankrnr32 force-pushed the shashankrnr32-patch-1 branch 4 times, most recently from 9557a97 to 89597e2 Compare February 20, 2021 06:13
@shashankrnr32 shashankrnr32 marked this pull request as ready for review February 20, 2021 07:04
Change `prop.type_` to `prop.outer_type_` to get the
correct type of the pydantic field when using List/Set/Tuple/Union

Optional[Type] does not work because of pydantic's internal
implementation to change outer_type

Fixes mkdocstrings#94
@pawamoy
Copy link
Member

pawamoy commented Feb 24, 2021

Thanks a lot !

I've pushed CI fixes on master, could you rebase?

@shashankrnr32
Copy link
Contributor Author

shashankrnr32 commented Feb 25, 2021

Thank you very much for the response. Have just rebased. Atleast at the time of writing this comment, CI build was stuck on macos3.8. Please do take a look when you get the chance.

@pawamoy
Copy link
Member

pawamoy commented Feb 25, 2021

Thanks again 🙂

@pawamoy pawamoy merged commit beddb31 into mkdocstrings:master Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Pydantic Field documentation generates wrong type for List/Set/Tuple
2 participants