django-ninja
django-ninja copied to clipboard
Possibility to provide custom examples for schemas
Hi folks,
FastAPI leverages Pydantic possibility to generate OpenAPI schema which besides other stuff also includes generation of the custom examples:
- https://fastapi.tiangolo.com/tutorial/schema-extra-example/#pydantic-schema_extra
- https://pydantic-docs.helpmanual.io/usage/schema/#schema-customization
Is this possible to have the same custom examples with Django Ninja? I could not get it work easily :(
UPD: I can see that openapi.json file contains all needed information about examples, so it seems like Swagger UI/layout thing that doesn't show examples
@roma-glushko
well it work for me on default settings:
which version for django/django-ninja do you use ?
I just opened PR https://github.com/vitalik/django-ninja/pull/588