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
{{ message }}
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.
The swagger specification (both V2 and V3) mentions:
To support polymorphism, Swagger adds the support of the discriminator field. When used, the discriminator will be the name of the property used to decide which schema definition is used to validate the structure of the model. As such, the discriminator field MUST be a required field.
Although the swagger-gradle-plugin generates a discriminator field in the swagger.json the property field is missing (and not required).
The documentation expresses this requirement even clearer (OA3, but equally applies to Swagger V2):
In our example, the discriminator points to the objectType property that contains the data type name. The discriminator is used with anyOf or oneOf keywords only. It is important that all the models mentioned below anyOf or oneOf contain the property that the discriminator specifies. This means, for example, that in our code above, both simpleObject and complexObject must have the objectType property. This property is required in these schemas.
The swagger specification (both V2 and V3) mentions:
Although the swagger-gradle-plugin generates a
discriminator
field in the swagger.json the property field is missing (and not required).The documentation expresses this requirement even clearer (OA3, but equally applies to Swagger V2):
Example (taken from the tests):
Currently swagger-gradle-plugin generated the following swagger-file for the classes above:
However, despite being referenced by the discriminator field the
__innerType
field does not exist. The expected generated output would be this:note the
__innerType
property and the required properties list.The text was updated successfully, but these errors were encountered: