OpenAPITypeProvider
OpenAPITypeProvider copied to clipboard
oneOf/anyOf workaround
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.
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.
Thanks, opened an issue here: https://github.com/Dzoukr/OpenAPIParser/issues/2