在swagger 3中不显示枚举值

guicsvcw  于 2021-07-11  发布在  Java
关注(0)|答案(0)|浏览(479)

有一个枚举类

@AllArgsConstructor
@ApiModel(description = ".")
public enum SomeEnum {

    SomeEnum_1(1),
    SomeEnum_2(2),
    SomeEnum_3(3),

 private final Integer type;
}

有课吗

@Getter
@Setter
@AllArgsConstructor
@ApiModel(description = ".")
public class Class{

private String param1;
@Schema(implementation = SomeEnum.class,allowableValues = "1,2,3,4")
private SomeEnum enum ;

类被传递给控制器。如何使枚举1/2/3/4的值在招摇中出现?示例方法:boolean getsome(类模型);

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'

    implementation 'io.springfox:springfox-boot-starter:3.0.0'
    implementation 'io.springfox:springfox-bean-validators:3.0.0'
    compile "io.springfox:springfox-swagger-ui:3.0.0"

    implementation 'org.springframework.boot:spring-boot-starter-validation'

    compileOnly 'org.projectlombok:lombok'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }
}

暂无答案!

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

相关问题