tiangolo / full-stack-fastapi-template

Full stack, modern web application template. Using FastAPI, React, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typing problem when using the `example` attribute of the `Path` class

EwertonDCSilv opened this issue · comments

I believe that keeping the restriction to Optional[Dict[str, Any]] makes the use of examples very rigid.

Wouldn't something like Optional[Union[str, Dict[str, Any]]] be more common?

image

Nor is the typing of documentation examples included.

image
image

@tiangolo It would be important to add a step in the release process that checks the typing signature via mypy