I am trying to implement Swagger to my rest api which is development with Java Spring Boot. There is a problem on model parts of swagger. The problem is Detail abstract class and extended classes are not seem in Swagger UI's and the other output files. I am just seeing the baseclass with detail object as null.
You can find the code on below.
public class BaseClass {
@ApiModelProperty(value ="Id of baseClass.", readOnly = true)
private String id;
@ApiModelProperty(value = "Description of baseClass.")
private String description;
@ApiModelProperty(value = "Value is equal to subclass json object value.")
private Detail detail;
...My abstract class which is attribute of baseclass.
@ApiModel(value = "Detail",subTypes = {Page.class,Rank.class},discriminator = "detail")
public abstract class Detail {
}My extended classes from Detail Abstract Class;
Page Class:
@ApiModel(parent = Detail.class,value = "Page")
public class Page extends Detail {
@ApiModelProperty(value = "The page URL.")
private String url;
...Rank Class:
@ApiModel(parent = Detail.class,value = "Rank")
public class Rank extends Detail {
@ApiModelProperty(value = "Number List of Rank")
private List<String> numbers;
...Which library do you use to generate the API definition?
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
swaggerVersion = '2.6.1'
compile ("io.springfox:springfox-swagger2:${swaggerVersion}")
compile ("io.springfox:springfox-swagger-ui:${swaggerVersion}")
compile ("io.springfox:springfox-staticdocs:${swaggerVersion}")
compile ("org.springframework.restdocs:spring-restdocs-mockmvc:1.2.0.RELEASE")
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
Springfox is not one o the libraries we maintain. You’d need to file a ticket with the project to get support.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.