Open deblockt opened 1 year ago
I'm using polymorpishm like this:
Create ContextType and add to each of your contexts:
"allOf": [
{
"$ref": "./context.json"
},
{
"type": "object"
...
}
And then inside Context add:
"discriminator": {
"propertyName": "type",
"mapping": {
"textContextValue": "#/definitions/TextContextValue",
"currencyContextValue": "#/definitions/CurrencyContextValue",
"whatsAppContextValue": "#/definitions/WhatsAppContextValue"
}
}
Description
When using polymorphism, the JsonSubType is duplicated, like on this example:
In this example the
JsonSubTypes.Type
annotation is duplicated. If I remove theallOf
onCurrencyContextValue
and onDateTimeContextValue
I have no issue. It seem that the allOf don't use thediscriminator
field. I can't find any solution.Swagger-codegen version
I use the gradle plugin
org.openapitools:openapi-generator-gradle-plugin:6.4.0
Swagger declaration file content or url
This swagger is generated from java annotation using these class:
Thanks for you help