ng-openapi-gen
ng-openapi-gen copied to clipboard
OneOf (from official doc) not working
Using this example: https://swagger.io/docs/specification/data-models/inheritance-and-polymorphism/
Using the latest version of ng-openapi-gen.


What I got:

What I expect:

It works if I add this into model.js:

And this into gen-util.js:

Workaround:
Use oneOf alone into an object and use allOf to inherit this object.

Same problem. I simply add hasOneOf to model.js as in example above
const hasOneOf = schema.oneOf && schema.oneOf.length > 0;
this.isObject = (type === 'object' || !!schema.properties) && !schema.nullable && !hasAllOf && !hasOneOf;
@luisfpg could please fix this next release
is it like this ? @luisfpg @BrothersWar @dgilsonAfelio
Any updated ? @luisfpg @BrothersWar @dgilsonAfelio