我有下面的openapi文档。我预计生成的API类名将是SampleApi,因为操作"/hello“被标记为”tags“。但是它使用operation名称生成API类名,它是HelloApi。我在这里错过了什么?我使用的是openapi-generator-maven-plugin版本3.3.1
openapi: "3.0.0" info: version: 1.0.0 title: Sample Service tags: - name: sample paths: /hello: get: summary: Says hello world operationId: greet tags: - sample responses: 200: description: ok content: plain/text:
`schema: type: string example: Hello World`发布于 2019-01-23 14:21:07
我找到了解决办法。我们需要在useTags的configOptions部分中使用设置为true的选项openapi-generator-maven-plugin
默认情况下,useTags设置为false,因此它不会使用标记名来创建API类名。
<configOptions>
<sourceFolder>openapi</sourceFolder>
<interfaceOnly>true</interfaceOnly>
<useBeanValidation>true</useBeanValidation>
<dateLibrary>java8-localdatetime</dateLibrary>
<useTags>true</useTags>
</configOptions>https://stackoverflow.com/questions/54310911
复制相似问题