Closed gberaudo closed 5 months ago
Hey @gberaudo - yep currently schema_class
expects a type which has a base of BaseModel
from pydantic so type adapters wouldn't work. As @jcklie suggested, you could try to use a root model for this use case as it should then conform to the expected interface
I want to return a special kind of JSON: a bare list of objects:
Pydantic provides the TypeAdapter to directly parse / serialize primitive types, and notably lists.
Unfortunately, using such adapter does not produces a class so it is not possible to use it directly with openapi-pydantic.
Is this use case handled by openapi-pydantic?