Open JesseDeLoore opened 2 days ago
@JesseDeLoore Thank you for your report.
Add prefixItems
to the Schema to solve the problem, and you are welcome to submit a PR.
class Schema(BaseModel):
...
schema_not: Optional[Union[Reference, "Schema"]] = Field(default=None, alias="not")
+ prefixItems: Optional[List[Union[Reference, "Schema"]]] = None
items: Optional[Union[Reference, "Schema"]] = None
...
https://github.com/luolingchun/flask-openapi3/pull/197
I hope I did an adequate job
Environment:
When typing a property with tuple[...] I would expect the OpenAPI spec to show which objects are accepted and in which order. Currently it just shows that an array is accepted, which of course is not the case.
Below is a working example.
The relevant part of the spec is:
When inspecting the model as generated by Pydantic you can see the options are available in "prefixItems"
I'm happy to write a PR if anyone knows in which direction to look to solve this issue.