You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given an object with oneOf and a discriminator mapping, the generator erroneously still allows the schema names as aliases during de-/serialization (even if an explicit mapping for a respective referenced schema exists).
This is present on master and affects at least 7.11.0 and 7.12.0. After digging into the code and git history, I have no reason to believe that there are unaffected versions.
In this example, the obj1 value is mapped to the Object1 model that is defined in the same spec, obj2 – to Object2, and the value system matches the sysObject model that is located in an external file. All these objects must have the objectType property with the value "obj1", "obj2" or "system", respectively.
Description
Given an object with
oneOf
and a discriminator mapping, the generator erroneously still allows the schema names as aliases during de-/serialization (even if an explicit mapping for a respective referenced schema exists).The spec says that only the explicit mappings should be usable. (See https://swagger.io/docs/specification/v3_0/data-models/inheritance-and-polymorphism/#discriminator)
For example:
openapi-generator version
This is present on
master
and affects at least7.11.0
and7.12.0
. After digging into the code and git history, I have no reason to believe that there are unaffected versions.OpenAPI declaration file content or URL
https://github.com/OpenAPITools/openapi-generator/blob/f39675b41af49851f05056009ccd4a823770a881/samples/openapi3/server/petstore/spring-boot-oneof/src/main/resources/openapi.yaml
Generation Details
No special set up required. Just use the sample.
Steps to reproduce
Just use the sample.
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: