django-pydantic-field
django-pydantic-field copied to clipboard
Django JSONField with Pydantic models as a Schema
If I define a model like the example: ```python class MyModel(models.Model): # Infer schema from field annotation foo_field: Foo = SchemaField() ``` Then I go ahead and create an empty...
Along with DRF's schema generators, it would be handy to have an adapter for `def-spectacular`, as it's becoming de-facto standard tool for OpenAPI schema generation in DRF.
I have the following pydantic models: ```python class EUTaxonomyValue(BaseModel): type: Literal["eu_taxonomy"] = "eu_taxonomy" nace_code: str economic_activity: str classification: str | None class EconomicActivity(BaseModel): type: Literal["economic_activity"] = "economic_activity" activity_code: str activity_name:...
Closes #43
Since Pydantic v2, it looks feasible to walk through the _what-is-called `CoreSchema`_, which is used by `pydantic_core` to perform the data validation/serialization. This opens up the door to get rid...
Is there a way to disable validation on retrieval? Currently Django will throw a 500 error if I have an object with an invalid schema in the database. Even when...
The docs we have at the moment only cover essential use cases, with lots of details missing. This indeed should be expanded. What should be added, to my knowledge: -...
Currently it's not possible to automatically infer corresponding serializer field type for `PydanticSchemaField`. Some third-party libraries patch `ModelSerializer` field registry to achieve such behaviour. What I'd like to know is:...
This is more likely relevant to serializer fields, though may still apply to parsers/renderers, that needs to be figured out. While rendering serializer schema, we can come up in the...