Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple 200 OK options? #810

Open
iconofsin opened this issue May 6, 2024 · 0 comments
Open

Multiple 200 OK options? #810

iconofsin opened this issue May 6, 2024 · 0 comments
Labels
question Further information is requested

Comments

@iconofsin
Copy link

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?

@iconofsin iconofsin added the question Further information is requested label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant