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
What would be the way to provide for multiple 200 OK response options (different data types) and have the structs be documented in the UI as well?
Putting multiple #[oai(status = 200)] items into a single ApiResponse struct results in only the last option being reflected as the OK response for all API methods, and also apparently violates the OpenAPI spec (even though Poem still happily generates it.)
Using an Enum seems and a single #[oai(status = 200)] item seems to be more correct OpenAPI-spec wise, but the UI still only shows the last option.
Any pointers/examples? Would using distinct ApiResponse enums be the only way to achieve this?
The text was updated successfully, but these errors were encountered:
What would be the way to provide for multiple 200 OK response options (different data types) and have the structs be documented in the UI as well?
Putting multiple
#[oai(status = 200)]
items into a singleApiResponse
struct results in only the last option being reflected as the OK response for all API methods, and also apparently violates the OpenAPI spec (even though Poem still happily generates it.)Using an Enum seems and a single
#[oai(status = 200)]
item seems to be more correct OpenAPI-spec wise, but the UI still only shows the last option.Any pointers/examples? Would using distinct ApiResponse enums be the only way to achieve this?
The text was updated successfully, but these errors were encountered: