【问题标题】:How to pass resolve-fully to swagger-codegen-maven-plugin?如何将解析完全传递给 swagger-codegen-maven-plugin?
【发布时间】:2020-10-09 09:32:40
【问题描述】:

如果我使用 swagger-codegen-cli 手动生成客户端 API,例如:

java -jar swagger-codegen-cli-3.0.21.jar generate -i file:///C:/Fredrik/Applications/Swagger/da_2.json -l java -o da_2_client -c da_2_options.json --resolve-fully

...然后我会得到我需要的所有课程。

但是如果你在 maven 中运行 swagger-codegen-maven-plugin,你如何传递参数 --resolve-fully

<plugin>
    <groupId>io.swagger.codegen.v3</groupId>
    <artifactId>swagger-codegen-maven-plugin</artifactId>
    <version>3.0.21</version>
    <executions>
        <execution>

            <id>deviceagent-client-interface</id>
            <goals>
                <goal>generate</goal>
            </goals>

            <configuration>

                <!-- the json-file -->
                <inputSpec>${basedir}/src/main/resources/da_2.json</inputSpec>

                <!-- target to generate java client code -->
                <language>java</language>

                <!-- the output dir -->
                <output>${basedir}</output>

                <!-- the config file -->
                <configurationFile>${basedir}/src/main/resources/da_2_options.json</configurationFile>

            </configuration>

        </execution>
    </executions>
</plugin>

没有 --resolve-fully 我会错过一些课程,例如 InlineResponse200。

最好的问候 弗雷德里克

【问题讨论】:

    标签: maven-plugin swagger-codegen


    【解决方案1】:

    看起来您不需要完全通过 --resolve-fully。 没有它生成的类就足够了。

    【讨论】:

      猜你喜欢
      • 2021-06-27
      • 1970-01-01
      • 1970-01-01
      • 2023-03-04
      • 2017-04-15
      • 2020-04-05
      • 1970-01-01
      • 2018-08-29
      • 2022-10-20
      相关资源
      最近更新 更多