如何解决尝试使用 open api 生成代码时未找到符号错误
我正在尝试将 open api 3 与 spring boot 2 一起使用。它生成 ApiUtil 类。我正在使用 JAVA 11。 但是在构建项目时找不到这个类。
[ERROR] /Users/bilelfrikha/Documents/clothes-api-many/clothes-api-interface/target/generated-sources/openapi/{project.build.directory}/generated-sources/swagger/src/gen/java/org/example/clothes/api/v1/ClothesApi.java:[175,21] cannot find symbol
symbol: variable ApiUtil
location: interface org.example.clothes.api.v1.ClothesApi
这是我的 pom.xml
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>
${basedir}/src/main/resources/clothes-api/clothes.yaml
</inputSpec>
<generatorName>spring</generatorName>
<generateSupportingFiles>true</generateSupportingFiles>
<apiPackage>org.example.clothes.api.v1</apiPackage>
<modelPackage>org.example.clothes.api.v1.dto</modelPackage>
<supportingFilesToGenerate>ApiUtil.java</supportingFilesToGenerate>
<apiDocsUrl>http://localhost:8080/v1/clothes-api-docs</apiDocsUrl>
<outputFileName>openapi.json</outputFileName>
<outputDir>${project.build.directory}</outputDir>
<configOptions>
<library>spring-boot</library>
<sourceFolder>{project.build.directory}/generated-sources/swagger/src/gen/java</sourceFolder>
<delegatePattern>true</delegatePattern>
<interfaceOnly>true</interfaceOnly>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。