-
-
Notifications
You must be signed in to change notification settings - Fork 179
discriminator support? #46
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
Comments
There are no near-term plans for this, but I would certainly review a PR for it. |
Ideally, I would add
to the But if I do that, I don't know where to get Also, it is a bit misleading that discriminator appears in Right now, what I do is add
This works because I added a schema definition registration helper to my framework to pass The whole inheritance mechanism is not well defined in OpenAPI yet so I only rely on |
This is now supported via the spec.definition('Pet', extra_fields={'discriminator': 'pet_type'}) |
Swagger 2.0 has 'discriminator' field, which is essentially used to choose the schema to use based on contents of the field. At least apispec 0.6 does not have this (nor does actually marshmallow itself, +- marshmallow-polyfield which is similar but helps choose type of field instead of the whole object's schema).
Any plans on this?
The text was updated successfully, but these errors were encountered: