首页 > 解决方案 > Swagger /v2/apo-docs 插入标签

问题描述

当我访问我的 http://localhost:8080/v2/api-docs 时,我得到了这个响应<Json>{"swagger":"2.0","info":{"description".....</Json>

这是一个无效的 json 响应,因为<Json>...</Json>标签。我该如何解决这个问题?

我正在使用 Spring Boot 和这个依赖项:

        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <scope>compile</scope>
        </dependency>
        <!-- Complete with project dependencies -->
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-xml</artifactId>
            <version>2.9.9</version>
        </dependency>

也许 jackson-dataformat-xml 干扰了输出?

我需要一个有效的 json 响应。

提前致谢。

标签: swaggerswagger-uispringfox

解决方案


推荐阅读