Skip to content

Add support for one-of with any type #133

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

Merged
merged 3 commits into from
Jun 17, 2019

Conversation

danielbradburn
Copy link
Contributor

This is a rebased version of my original PR rebased on p1c2u/master to get rid of the unnecessary strict validation changes. This pull requests adds support for various cases of oneOf in combination with a SchemaType.ANY schema that currently fail to unmarshal correctly, for example...

Polymorphic:
  oneOf:
    Values:
      type:  array
      items:
        type: string
    Value:
      type: string

@diogobaeder
Copy link

Hi,

I think this would fix #127 too, right? My case there involves primitives and list of primitives, but it seems to be acting on the same mechanics.

BTW, the build failed only because of an unused import, if you remove it it should pass :-)

Cheers,
Diogo

@diogobaeder
Copy link

@danielbradburn do you still have interest on this pull request? Otherwise I'll use your changes in another pull request I'd like to send, to fix arrays of oneOf.

@p1c2u any chance you can give this some review? This might bring us one step closer to fix a bunch of other issues:
#129
#115
#64

If you want, just add me as a core contributor and I'll take care of those. This issue with arrays of oneOf, in particular, is blocking me with a critical application I'm building at my work.

@danielbradburn
Copy link
Contributor Author

@danielbradburn do you still have interest on this pull request? Otherwise I'll use your changes in another pull request I'd like to send, to fix arrays of oneOf.

Yes these changes would be very helpful for us. I will make the change to fix the linter, @p1c2u are there any other changes that would be required to get this merged?

@p1c2u
Copy link
Collaborator

p1c2u commented Jun 7, 2019

@danielbradburn fix it and we can merge it

@danielbradburn
Copy link
Contributor Author

@p1c2u great thanks! I fixed the linter errors now.

@p1c2u p1c2u merged commit 0df1d05 into python-openapi:master Jun 17, 2019
@vyakoviv-vs
Copy link

vyakoviv-vs commented Aug 14, 2019

Hello. Could anybody please post a working example of the schema with oneOf?
Playing with the 0.11.0, the example at the beginning does not work. My examples does not work neither.
Many Thanks!

openapi-core 0.11.0
openapi-spec-validator 0.2.6

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.

4 participants