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

oneOf/anyOf workaround #17

Open
cmeeren opened this issue Mar 25, 2019 · 2 comments
Open

oneOf/anyOf workaround #17

cmeeren opened this issue Mar 25, 2019 · 2 comments

Comments

@cmeeren
Copy link

cmeeren commented Mar 25, 2019

I'm considering using this TP, but I need to know a little bit more about how it handles oneOf/anyOf.

The readme states that oneOf and anyOf (well, it says manyOf, but that's an error, it should be anyOf) are not supported. But what happens when the TP encounters these in an OpenAPI document? Can it parse the document at all?

If the TP gives an error when encountering these, then that's a show-stopper for using this TP, because any API provider may add oneOf/anyOf at any time, rendering this TP suddenly useless for that API and requiring a massive rewrite of client code.

A workaround could be that oneOf and anyOf can be treated as allOf, except that everything is optional. Then at least you have the possibility to use the TP for documents that have oneOf/anyOf; you'd just have to make sure that you use a valid combination of properties.

@Dzoukr
Copy link
Collaborator

Dzoukr commented Mar 25, 2019

Hi, it is based on OpenAPIProvider where oneOf / anyOf is not supported yet - https://github.com/Dzoukr/OpenAPIParser/blob/master/src/OpenAPIParser/Version3/Specification.fs. I think having such thing in yaml will just be ignored.

@cmeeren
Copy link
Author

cmeeren commented Mar 25, 2019

Thanks, opened an issue here: Dzoukr/OpenAPIParser#2

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

No branches or pull requests

2 participants