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
One may show the nodel JSON schema within class doc string as a collapsable code block via :model-show-json:. This depends on the model to be completely JSON serializable. However, users may provide custom fields that are not serializable by default. This breaks the schema generation.
Currently, this is handled by intercepting such non serializable fields and replacing their types and default values to indicate an error. This is rather implicit even though there is an explicit remark in the documentation.
To improve, let's make the error handling configureable, like autodoc_pydantic_model_show_json_error_handling to be one of:
raise: Do not handle the error. Propagate it.
ignore: Drop all fields from the schema that are not JSON serializable and provide warning in the sphinx output.
coerce: Keep violating field names (and types?) but replace default (None?) and provide warning in the sphinx output.
The text was updated successfully, but these errors were encountered:
One may show the nodel JSON schema within class doc string as a collapsable code block via
:model-show-json:
. This depends on the model to be completely JSON serializable. However, users may provide custom fields that are not serializable by default. This breaks the schema generation.Currently, this is handled by intercepting such non serializable fields and replacing their types and default values to indicate an error. This is rather implicit even though there is an explicit remark in the documentation.
To improve, let's make the error handling configureable, like
autodoc_pydantic_model_show_json_error_handling
to be one of:None
?) and provide warning in the sphinx output.The text was updated successfully, but these errors were encountered: