【发布时间】: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