Spring 招摇:不同型号的规格版本

bxgwgixi  于 2021-07-13  发布在  Java
关注(0)|答案(0)|浏览(150)

我有一个典型的模型

@Entity
public class MyPojo {

    public Long id;          // common
    public String property   // common
    public String propertyV1 // v1
    public String propertyV2 // v2
}

我还知道,我可以在swagger配置上提供几个docketbean,比如

@Bean Docket api1() {
    return new Docket(DocumentationType.SWAGGER_2)
        .apiInfo(apiInfo1)
        .groupName("api1")
        .select()
        .apis(RequestHandlerSelectors.basePackage("com.company.controller"))
        .paths(PathSelectors.any())
        .build();
}

@Bean Docket sitesAPI() {
    return new Docket(DocumentationType.SWAGGER_2)
        .apiInfo(apiInfo2)
        .groupName("api2")
        .select()
        .apis(RequestHandlerSelectors.basePackage("com.company.controller"))
        .paths(PathSelectors.any())
        .build();
}

有什么注解我可以用在上面吗 propertyV1 以及 propertyV2 ,或方法,这样当我从swagger ui的specification选择器中选择时,在请求条件的model description中,我只看到公共属性加上该api版本的属性?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题