我正在从 swagger (Open API 2) 迁移到 springdoc (Open API 3),但今天在某些情况下,我使用 swagger-codegen-maven-plugin 从 yaml 生成代码(用于客户端和提供者),遵循 Contract First 策略. 下面是配置示例:
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>2.4.9</version>
<executions>
<execution>
<id>generate-provider-v1</id>
<phase>generate-resources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/swagger/my-api.yaml</inputSpec>
<output>${project.build.directory}/generated-sources/swagger</output>
<language>spring</language>
<library>spring-boot</library>
<modelPackage>br.com.sample.representation</modelPackage>
<apiPackage>br.com.sample.adapter.controller.v1</apiPackage>
<generateSupportingFiles>true</generateSupportingFiles>
<configOptions>
<interfaceOnly>true</interfaceOnly>
<delegatePattern>true</delegatePattern>
<dateLibrary>java8</dateLibrary>
</configOptions>
<modelNameSuffix>Representation</modelNameSuffix>
<generateSupportingFiles>false</generateSupportingFiles>
</configuration>
</plugin>
是否有任何等效选项可以使用 springdoc-openapi-maven-plugin 生成代码?