You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何为swagger-codegen-maven-plugin传入--resolve-fully参数?

How to Pass --resolve-fully to swagger-codegen-maven-plugin

Hey Fredrik, I’ve got you sorted on this! The --resolve-fully command-line flag you use with the standalone CLI maps directly to a camelCase configuration parameter in the Maven plugin. Here's exactly how to update your setup to include it:

Updated Plugin Configuration

Add the <resolveFully>true</resolveFully> line inside the <configuration> section of your plugin execution. This tells the codegen to fully resolve all referenced models—including those inline responses like InlineResponse200 that you’re currently missing:

<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>
        <!-- Equivalent to --resolve-fully flag in CLI -->
        <resolveFully>true</resolveFully>
      </configuration>
    </execution>
  </executions>
</plugin>

Why This Works

Maven plugin parameters follow a simple conversion rule: kebab-case command-line flags (like --resolve-fully) become camelCase (resolveFully) in XML configuration. Enabling this ensures all nested or referenced schema definitions are fully expanded and generated as distinct classes, instead of being skipped or inlined.

After updating your pom.xml, run mvn generate-sources (or your regular build command) and you should see all the missing classes like InlineResponse200 show up in your generated output.

内容的提问来源于stack exchange,提问作者user2902165

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.09 14:42:49