[BUG] Maven plugin - Error in spec validation does not fail build
Created by: Mobe91
Description
With skipValidateSpec=false the Maven build succeeds even though spec validation logs errors.
openapi-generator version
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>6.4.0</version>
</plugin>
OpenAPI declaration file content or url
components:
schemas:
ContainerItemResponse:
properties:
container:
type: object
$ref: '#/components/schemas/Container'
Container:
properties:
containerType:
type: string
provokes
[ERROR] Illegal schema found with $ref combined with other properties, no properties should be defined alongside a $ref:
Yet, the Maven build succeeds.
Generation Details
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<executions>
<execution>
<id>xs2r-api-generation</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/../spec/api.yml</inputSpec>
<generatorName>spring</generatorName>
<auth>true</auth>
<supportingFilesToGenerate>ApiUtil.java</supportingFilesToGenerate>
<skipValidateSpec>false</skipValidateSpec>
<generateModels>false</generateModels>
<configOptions>
<languageSpecificPrimitives>
OrderStatus
</languageSpecificPrimitives>
<delegatePattern>true</delegatePattern>
</configOptions>
<typeMappings>
<typeMapping>string+date-time=Instant</typeMapping>
</typeMappings>
<importMappings>
Instant=java.time.Instant
</importMappings>
</configuration>
</execution>
</executions>
</plugin>