Skip to content

Fix response_model typing#2991

Closed
WilliamWCYoung wants to merge 1 commit intofastapi:masterfrom
WilliamWCYoung:master
Closed

Fix response_model typing#2991
WilliamWCYoung wants to merge 1 commit intofastapi:masterfrom
WilliamWCYoung:master

Conversation

@WilliamWCYoung
Copy link
Copy Markdown

Fix response_model typing when following documentation's List[FooModel] example:

https://fastapi.tiangolo.com/tutorial/extra-models/#list-of-models

The documentation suggests something that conflicts with the typing, which is raised when using Pycharm:

Expected type 'Optional[type]', got 'GenericAlias' instead

This PR adds this type so warnings are not raised.

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.

1 participant