Closed nicholascross closed 4 years ago
Thanks @nicholascross. It's strange to have a spec with just a single oneOf, but I guess if you do this makes it better. Could you add a changelog as well, and a test case to https://github.com/yonaskolb/SwagGen/blob/master/Specs/TestSpec/spec.yml
Generating oneOf types hasn't been implemented yet, but could be done by generating an enum with associated types within the containing type.
Thanks @yonaskolb! I will make the requested changes in the near future.
The swagger spec I am using is automatically generated from server side code and I think it comes into play anytime there is some kind of inheritance going on in the backend models.
I like the idea of enum for greater support of this part of the spec. I might have a crack at it when I get some free time.
Hi, @nicholascross
Excuse me, could you take a look at the issue #267 related with the PR? I have a question about the allOf
with inline schema. Thank you.
This avoids hitting the fallback to using the property name which without further intervention results in missing types when compiling generated code.
Before
After
This change still would result in compilation errors for generated code where there was more than one possible schema for a group schema. Is there a proposed or correct way of handling this?
From what I can tell right now this will just generate the property type using a camel cased property name which seems a bit fragile - I am assuming the intention is this type be implemented manually but that seems error prone as there is the possibility of type collisions.