I am using swagger-codegen-maven-plugin version: 2.4.8
If discriminator and property exists with the same name. Spring rest response has duplicated fields.
it is generated:
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@type", visible = true )
JsonTypeInfo.As.PROPERTY is always generated(it is not parametrized anyway) It would be better to generate in such case:
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "@type", visible = true )
I am using swagger-codegen-maven-plugin version: 2.4.8 If discriminator and property exists with the same name. Spring rest response has duplicated fields.
for such definition:
"Pet": { "type": "object", "required": [ "name", "petType" ], "properties": { "name": { "type": "string" }, "petType": { "type": "string" } }, "discriminator": "petType", }
it is generated:
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@type", visible = true )
JsonTypeInfo.As.PROPERTY is always generated(it is not parametrized anyway) It would be better to generate in such case:
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "@type", visible = true )
So fields won't be duplicated in rest response.