OpenAPI-Generator wirft Fehler für submission-api.yaml
Bei der Erzeugung eines API-Clients für Java läuft der OpenAPI-Generator (Version 6.1.0) in einen Fehler.
Befehl:
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i https://schema.fitko.de/fit-connect/submission-api/1.1.0/submission-api.yaml -g java -o C:\....\output
Ausgabe:
[main] INFO o.o.codegen.utils.ModelUtils - [deprecated] inheritance without use of 'discriminator.propertyName' has been deprecated in the 5.x release. Composed schema name: null. Title: Einreichung
[main] INFO o.o.codegen.utils.ModelUtils - [deprecated] inheritance without use of 'discriminator.propertyName' has been deprecated in the 5.x release. Composed schema name: null. Title: null
[main] WARN o.o.codegen.utils.ModelUtils - Failed to get the schema name: #/paths/~1v1~1destinations/post/responses/201/headers/Location
Exception in thread "main" 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: 1, Warning count: 0
Errors:
-attribute components.callbacks(post).parameters.There are duplicate parameter values
at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:604)
at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:631)
at org.openapitools.codegen.cmd.Generate.execute(Generate.java:457)
at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
Dasselbe Verhalten tritt auch für das openapi-generator-maven-plugin in Version 6.0.0 auf. Verzichtet man auf die Validierung mit --skip-validate-spec lässt sich ein Client erzeugen, allerdings sieht man auf der Konsole hier ebenfalls eine Fehlermeldung und einige Warnungen:
[main] WARN o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: PublicDestination
[main] WARN o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: PublicDestination
[main] WARN o.o.c.languages.AbstractJavaCodegen - Ignoring complex example on request body
[main] WARN o.o.codegen.DefaultCodegen - allOf with multiple schemas defined. Using only the first one: PublicDestination
[main] WARN o.o.c.languages.AbstractJavaCodegen - Ignoring complex example on request body
[main] WARN o.o.codegen.utils.ModelUtils - Failed to get the schema name: #/paths/~1v1~1destinations/post/responses/201/headers/Location
[main] WARN o.o.codegen.DefaultCodegen - No schema defined for Header 'Location', using a String schema
[main] WARN o.o.codegen.utils.ModelUtils - Failed to get the schema name: #/paths/~1v1~1destinations/post/responses/201/headers/Location
[main] ERROR o.o.codegen.DefaultCodegen - Not handling class Parameter {
name: Location
in: header
description: null
required: null
deprecated: null
allowEmptyValue: null
style: null
explode: null
allowReserved: null
schema: null
examples: null
example: null
content: null
$ref: null
} as Body Parameter at the moment
[main] ERROR o.o.codegen.DefaultCodegen - Not handling class Parameter {
name: Location
in: header
description: null
required: null
deprecated: null
allowEmptyValue: null
style: null
explode: null
allowReserved: null
schema: null
examples: null
example: null
content: null
$ref: null
} as Body Parameter at the moment