-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
additionalProperties
not correctly handled
#1662
Comments
Hi If you're using CLI to generate pojos - then please add
Ie.
|
I tried that but this is a problematic part of the CLI flag. I don't want it on all objects - just the ones with |
From what can be seen in I guess that description in /**
* Gets the 'includeAdditionalProperties' configuration option.
*
* @return Whether to allow 'additional properties' support in objects.
* Setting this to false will disable additional properties support,
* regardless of the input schema(s).
*/ We can also check the source code If the flag is not enabled then regardless of schema Some possible workarounds:
|
I'm confused - your wiki states with examples that you natively support As mentioned in the OP I was expecting that an object that is only declared with |
Unfortunatelly that is not supported without enabling additional properties support (which in turn would generate additional properties for objects that do not explicitly specify |
I'm trying to generate types for the SARIF JSON Schema spec - https://json.schemastore.org/sarif-2.1.0.json
In particular they have defined:
I would have expected that this would generate a class with
additionalProperties
as mentioned in the wiki, like:However instead this generates a class without
additionalProperties
:This of course causes a crash when deserialising an object that uses the map
Is this a bug in the codegen, or am I "holding it wrong"?
The text was updated successfully, but these errors were encountered: