简体   繁体   中英

Hide parameters in Swagger + Spring boot

I'm developing an application with Spring Boot 2 + Swagger 3 please find Swagger dependencies below

       <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-boot-starter</artifactId>
            <version>3.0.0</version>
        </dependency>

I have multiple Rest controller one method can find below

@PostMapping(value = "/del", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public Flux<Map<String, Object delete(@ApiParam(required = true, value = "file name(s) to delete") @RequestBody Flux<String> files) {
       .........
}

But in Swagger UI it showing other parameters too. How to hide all these extra parameters (formData, query) except actual parameter (files).

在此处输入图像描述

try with @ApiIgnore before parameter

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM