I'm using Open-API to generate java class using yaml file. when i run
mvn clean install
i'm getting this error :
unexpected error in Open-API generation
org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
| Error count: 3, Warning count: 6
Errors:
-attribute paths.'/path/{id}'(delete).operationId is repeated
-attribute paths.'/path/name'(get).operationId is repeated
How can i skeep this validation ?
For me, the correct place of validateSpec was configuration instead of configOptions
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>6.2.1</version>
<executions>
<execution>
<id>abc-api</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
...
<validateSpec>false</validateSpec>
<skipValidateSpec>true</skipValidateSpec>
<configOptions>
<developerOrganization>ABC</developerOrganization>
...
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
Note: I have to add both validateSpec and skipValidateSpec for version 6.2.1 as per suggestion in an open bug https://github.com/OpenAPITools/openapi-generator/issues/9815
for Version 7.1.0
<skipValidateSpec>true</skipValidateSpec>
did the trick
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>7.1.0</version>
<executions>
<execution>
<id>generate-client-code</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<skipValidateSpec>true</skipValidateSpec>
(....)
</configuration>
</execution>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With