Skip to content

Inheritance polymorphism#560

Closed
lfiedler wants to merge 2 commits intomarshmallow-code:devfrom
lfiedler:inheritance_polymorphism
Closed

Inheritance polymorphism#560
lfiedler wants to merge 2 commits intomarshmallow-code:devfrom
lfiedler:inheritance_polymorphism

Conversation

@lfiedler
Copy link
Copy Markdown

@lfiedler lfiedler commented May 3, 2020

This is a draft adressing issue #557. It is based on the pr #554.

I copied the changes proposed there and adjusted them to the needs in #557. In particular, when cleaning operations it will now check for
keywords allOf. anyOf, oneOf and not at response or request contents.
Depending on openapi version not all keywords are checked. The places at which are checked also depend on the version.

@stefanv
Copy link
Copy Markdown

stefanv commented May 22, 2020

@lfiedler Will this also address #391, or should I revisit that PR again?

@lfiedler
Copy link
Copy Markdown
Author

@stefanv I believe it does not address #391 but I do not know for sure. The changes I proposed are independent and outside of the marshmallow extension. They are supposed to work when directly using above mentioned keywords in operations in APISpec.path (see #557 for an example).

To be more precise these changes only act on things that are passed to APISpec.clean_parameters.
If a schema gets resolved before that method is called and the schema gets replaced by a reference, then clean_parameters will not be able to treat this.
On the other hand the changes will not descend too deep into the schema found but instead will only check on the highest level.

Having said that, I don't know what the marhsmallow plugin does. Also I have not tested what happens when using it in conjunction with the marshmallow schema plugin and a marshmallow schema that uses polymorphism.

@lafrech
Copy link
Copy Markdown
Member

lafrech commented Jul 26, 2021

Thanks for the PR and sorry about the delay.

The recent rework (#655, #671) achieves this.

@lafrech lafrech closed this Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants