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

Allow for multiple response schemas for each response code #274

Open
dgbttn opened this issue Jan 19, 2021 · 1 comment
Open

Allow for multiple response schemas for each response code #274

dgbttn opened this issue Jan 19, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@dgbttn
Copy link

dgbttn commented Jan 19, 2021

I want to request a feature in Flask-restx which is similar to one describing in OAI/OpenAPI-Specification#270

In details, I return some 200 HTTP responses with different schemas, however the current swagger of Flask-restx has not supporting the 'oneOf' in response schema. This disallows me to resolve my problem.

I want to refer this comment on the above issue in order to clear my desire.

@dgbttn dgbttn added the enhancement New feature or request label Jan 19, 2021
@j5awry
Copy link
Contributor

j5awry commented Feb 17, 2021

Reading the linked OpenAPI Spec ticket, they're citing this as addressed with anyOf and oneOf and the various things added in OpenAPI 3.0

From that would you (and other readers) accept that a move to include OpenAPI 3.0 as a way to meet this request? Or do you want something more like what was originally asked for and debated?

The issue will be that flask-restx may be able to create different schemas, but we'll fall into some major issues because it won't be supported the same way in OpenAPI 3.0. That means things like "we'll have to make 2 specs, with different links" or something like that (which is probably not super desirable).

Gut check says "different responses with different schemas = different endpoint" which is a distillation of part of the discussion in the spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants