有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何删除或隐藏SwaggerUI版本3中的Header参数

我正在开发3.0.0版的大摇大摆用户界面。当我实现swagger注释时,我的API在swagger UI中显示了一些额外的参数。参数看起来像

可接受语言[0]。国家/地区“”可接受语言[0]。显示国家/地区

我使用的是springfox依赖

        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>3.0.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-boot-starter</artifactId>
            <version>3.0.0</version>
        </dependency>

这是我的摘要代码

@Bean
    public Docket docket() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.any())
                .paths(PathSelectors.any())
                .build()
                .apiInfo(apiInfo());
    }

ApiInfo apiInfo() {
    return new ApiInfoBuilder()
            .title("title")
            .description("Demo")
            .build();
}

这是我指的API头代码。没有什么能比得上可接受的语言[0]。我添加了这个国家,但它仍然显示在我的大摇大摆的用户界面中。这是可接受的语言[0]。国家甚至在添加@ApiImplicitParams之前就已经开始显示了

@ApiImplicitParams({
            @ApiImplicitParam(name = "ID", value = "ID", paramType = "header"),})

我还添加了一个界面截图。任何帮助都会很好。 Swagger UI 我想删除可接受的语言[0]。显示国家和所有其他参数


共 (0) 个答案