Can't mix and match polymorphic annotation declarations
If I have a base model declared in Java, with an ApiModel annotation, and some jackson annotations:
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.PROPERTY, property="type", defaultImpl=Animal.class)
@JsonSubTypes({
@Type(value = Cat.class, name = "cat"),
@Type(value = Dog.class, name = "dog") })
@ApiModel(value="Animal description")
public class AttributeSource
{
...
}
Then the model's 'subTypes' and 'discriminator' properties are empty. I need to explicitly define them in the ApiModel annotation or remove the ApiModel annotation
Thanks, this is fixed in develop and pushed to 1.3.1-SNAPSHOT
Hello,
Feel free to correct me if I'm wrong, but I think this might still be an issue. ApiModel.discriminator has an empty string as a default value, so it will still choose ApiModel's discriminator over JsonTypeInfo.property.
And I think ApiModel.subTypes suffers from the same problem as well.
I made the following change in my repo: 9ebafcb977c5d29fb35ee865dd9a77bae2e5f0c1
Please let me know if I've missed anything. Thanks