Facing some problem with Swagger generated Json schema.
I have a one base class which of type abstract class. And two classes extends this base class. And main transfer object object contains abstract class filed so that it will acts as a common placeholder for two types of extended classes
I can achieve this by using Jackson annotations. But Swagger is respecting jackson annotations.
Using Jackson:
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({@JsonSubTypes.Type(ExtendedClass1.class), @JsonSubTypes.Type(ExtendedClass2.class)})
private BaseClass baseClass;
Swagger just says, need to pass the object of type base class, but I want swagger to construct the json schema with the details of the extended classes and display it.
Swagger json schema looks like:
"baseClass" : "BaseClass"
But I want swagger to expand the extended classes also.
Is there any way I can impose swagger to use the jackson annotations?