You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not specifying the additionalProperties property and in this case, because of the specification mentioning:
By default any additional properties are allowed.
I would expect the JsonWebKey generated class to contain the Map<String, Object> additionalProperties (and get/put methods) to be generated. But it is not !
It seems the only way to generate this map is to use either:
additionalProperties: true
Or:
additionalProperties:
type: string
Which I would like to avoid and shouldn't be necessary.
Running mvn clean install, then looking at the generated file if the Map is generated or not: target/generated-sources/openapi-server/src/main/java/com/example/models/JsonWebKey.java
Related issues/PRs
Suggest a fix
I can suggest something but I would like to know first if this is really a bug or if I am missing something.
The text was updated successfully, but these errors were encountered:
did you try setting disallowAdditionalPropertiesIfNotPresent to false? (e.g. --additional-properties disallowAdditionalPropertiesIfNotPresent=false in CLI)
Bug Report Checklist
Description
Hello,
Regarding
additionalProperties
and the specification here: https://json-schema.org/understanding-json-schema/reference/object#additionalproperties, I think there might be a bug in the Java spring generator.I'm not specifying the
additionalProperties
property and in this case, because of the specification mentioning:I would expect the
JsonWebKey
generated class to contain theMap<String, Object> additionalProperties
(and get/put methods) to be generated. But it is not !It seems the only way to generate this map is to use either:
Or:
Which I would like to avoid and shouldn't be necessary.
Am I missing something ?
Thank you for your help !
openapi-generator version
7.10.0 (current latest)
7.11.0-SNAPSHOT (2b891f6)
OpenAPI declaration file content or url
My
src/main/resources/swagger/swagger.yaml
file:Generation Details
I'm using this
pom.xml
:https://gist.github.com/ncelerier/1729b37b6f9d37aefc8af33926fed07b
Steps to reproduce
Running
mvn clean install
, then looking at the generated file if the Map is generated or not:target/generated-sources/openapi-server/src/main/java/com/example/models/JsonWebKey.java
Related issues/PRs
Suggest a fix
I can suggest something but I would like to know first if this is really a bug or if I am missing something.
The text was updated successfully, but these errors were encountered: