Swagger Maven 插件不生成操作和模型

ka3*_*3ak 5 java maven swagger

我有一个 Spring Boot 应用程序并使用来自https://github.com/kongchen/swagger-maven-plugin的 Swagger Maven 插件

pom.xml中的配置如下:

        <plugin>
            <groupId>com.github.kongchen</groupId>
            <artifactId>swagger-maven-plugin</artifactId>
            <version>3.1.8</version>
            <configuration>
                <apiSources>
                    <apiSource>
                        <attachSwaggerArtifact>true</attachSwaggerArtifact>
                        <outputFormats>json</outputFormats>
                        <locations>package.with.apis</locations>
                        <schemes>
                            <scheme>http</scheme>
                            <scheme>https</scheme>
                        </schemes>
                        <host>localhost:8083</host>
                        <basePath>/api</basePath>
                        <info>
                            <title>Your API name</title>
                            <version>v2</version>
                            <description>Description of your API</description>
                        </info>
                        <swaggerDirectory>generated/swagger-ui</swaggerDirectory>
                    </apiSource>
                </apiSources>
            </configuration>
            <executions>
                <execution>
                    <phase>compile</phase>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
Run Code Online (Sandbox Code Playgroud)

<locations>package.with.apis</locations>是包含所有标记为的接口的包@Api

<swaggerDirectory>generated/swagger-ui</swaggerDirectory>swagger.json是生成的落地目录

但生成的不包含、DTO 模型等swagger.json中的信息。@ApiOperation, @ApiResponses

它似乎只包含以下值@Api(tags = {"API ..."})

以下是其摘录:

{
  "swagger" : "2.0",
  "info" : {
    "description" : "Description of your API",
    "version" : "v2",
    "title" : "Your API name"
  },
  "host" : "localhost:8083",
  "basePath" : "/api",
  "tags" : [ {
    "name" : "API 1",
    "description" : ""
  }, {
    "name" : "API 2",
    "description" : ""
  }, {
...
Run Code Online (Sandbox Code Playgroud)

我缺少什么?我应该如何正确配置它,以便它生成一个 JSON,该 JSON 描述的 API 与我们通常在http://localhost:8080/swagger-ui.html端点看到的完全可比?