Closed CarstenKarbach closed 1 year ago
Example:
class Item(BaseModel): key: str class ItemList(BaseModel): __root__: list[Item]
produces this generic openapi schema, which cannot really be used:
"ItemList": { "title": "ItemList", "type": "array" },
While with version 0.4.1 I am getting this schema:
"ItemList": { "items": { "$ref": "#/components/schemas/Item" }, "title": "ItemList", "type": "array" },
It looks like the __root__ attribute is not handled as before. When I replace this with any other attribute name like this:
__root__
class ItemList(BaseModel): test: list[Item]
the schema is correctly generated.
Thanks for raising! I'll take a look and fix this
Example:
produces this generic openapi schema, which cannot really be used:
While with version 0.4.1 I am getting this schema:
It looks like the
__root__
attribute is not handled as before. When I replace this with any other attribute name like this:the schema is correctly generated.