-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Description
I have an api spec which successfully generated server stub using "openapi-generator-gradle-plugin" version 3.3.4, however it gives spec validation error with plugin version 4.0.0
Spec is having "additionalProperties: false" in data models, and when I try to generate source i get below error :
`* What went wrong:
Execution failed for task ':openApiGenerate'.
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: 2
Errors:
-attribute components.schemas.Home.additionalProperties is not of typeobject
Warnings:
-attribute components.schemas.Home.additionalProperties is not of typeobject
`
part of model below
schemas: Home: type: object additionalProperties: false properties: name: type: string
Plugin task configuration:
openApiGenerate { generatorName = "jaxrs-jersey" inputSpec = "$rootDir/src/main/resources/home.yml".toString() outputDir = "$rootDir".toString() apiPackage = "com.home.rest.resources" invokerPackage = "com.home.rest" modelPackage = "com.home.rest.model" modelFilesConstrainedTo = [] configOptions = [ dateLibrary: "java8" ] }
As per documentation here boolean should be allowed:
https://swagger.io/docs/specification/data-models/data-types/#additionalProperties