You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we can avoid any by adding an optional type json_schema when defining the field, like this:
Or is there any better way to achieve this?
The text was updated successfully, but these errors were encountered:
LanceMoe
changed the title
pydantic_model_creator should support JSONField annotation (type hints)pydantic_model_creator should support JSONField annotation (type hints)
Aug 31, 2024
Is your feature request related to a problem? Please describe.
The types of JSONField are all displayed as Any in swagger:
I need to import
openapi.json
into a TypeScript project for use, and this makes the generatedopenapi.json
very poor in usability.Describe the solution you'd like
I found in
tortoise/contrib/pydantic/creator.py
hasI think we can avoid any by adding an optional type
json_schema
when defining the field, like this:Or is there any better way to achieve this?
The text was updated successfully, but these errors were encountered: