我试图为我的项目中的两个作用域生成两个控制器类。我可以通过两个单独的openapi.yaml文件和两个maven执行来实现这一点。
我正在使用swagger-codegen-maven-plugin来完成它,我只能找到使用不同插件的swagger.yaml或openapi.yaml的代码。我找不到这个密码,虽然我肯定这是可能的。
问题是,如果我有两个作用域,如'DB‘和'Browse',并且我希望为两个作用域(如DBApi.java和BrowseApi.java )创建两个接口,那么如何才能这样做,如果可以使用一个openapi.yaml文件来完成呢?
我确实看到了一个openapi.yaml文件导致PetApi.java和StoreApi.java的示例项目,但是在我的设置中找不到如何配置它。
谢谢。
maven pom文件中的相关部分是:
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<executions>
<execution>
<id>raptor-codegen</id>
<configuration>
<apiPackage>com.app.seo.graph.rest.v1.api</apiPackage>
<modelPackage>com.app.seo.graph.rest.v1.model</modelPackage>
<inputSpec>${project.basedir}/src/main/resources/api/openapi.yaml</inputSpec>
<configOptions>
<dateLibrary>java8</dateLibrary>
<additional-properties>preAuthorize=hasAuthority,useJsonPropertyOrder=true,resourceMetaType=com.ebay.jaxrs.server.ResourceOperation</additional-properties>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>发布于 2022-10-14 14:18:11
我在我的Maven文件中使用了<configOptions>下的<configOptions>,它对我很有用。YAML定义
paths:
'/operation/':
get:
tags:
- Some-Service使用SomeServiceApi生成器生成“SpringCodegen”类名。在"6.2.0“版本中使用”openapi生成器-maven-plugin“。
https://stackoverflow.com/questions/71316616
复制相似问题