LiveRamp / reslang

A language for describing resource-oriented APIs & turning them into Swagger or resource diagrams. Oriented around the concepts we want to expose in the APIs.
Apache License 2.0
23 stars 7 forks source link

Add `type` to `allOf` field schemas #73

Closed dimatkach closed 4 years ago

dimatkach commented 4 years ago

The server, generated by openapi-generator does not appear to like things wrapped into allOf (except for unions, unions work for some reason :/): connetxion wants the type to be at the top level (to check that it is not array), and when it's not there, it fails with KeyError.

I think, I found a way to work around that without breaking anything else: adding type to allOf schema is not required by swagger, but does not seem to hurt anything (also, I think it is technically incorrect not to have the type there – it probably just assumes it's an object, because what else? ... but it could be for instance an enum).

Also, the second commit here is to allow underscores in names. These are rather common in python, and code generation gets pretty confused by camelCase names sometimes.