Fix generator to include additional properties with boolean values#3553
Merged
Conversation
The EntityV3APISpec.interface property references EntityV3APISpecInterface as its type, but the model file was never committed. This caused a NameError at deserialization time for any response using that field. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…odels The child_models() guard skipping pure-map schemas checked only whether additionalProperties was present in the schema, not whether its value was a real schema object. This caused schemas with additionalProperties: false (e.g. EntityV3APISpecInterface, a oneOf with strict no-extra-props) to be incorrectly skipped — same as a pure Hash<String, T> map — which is why entity_v3_api_spec_interface.rb was never generated. Fix mirrors the pattern already used in type_to_ruby(): only treat additionalProperties as a map type when its value is not in (None, False). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
MintsInc
approved these changes
Jul 7, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 7, 2026
…3553) * fix: add missing EntityV3APISpecInterface model and inflector entry The EntityV3APISpec.interface property references EntityV3APISpecInterface as its type, but the model file was never committed. This caused a NameError at deserialization time for any response using that field. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * pre-commit fixes * fix: treat additionalProperties: false as a regular object in child_models The child_models() guard skipping pure-map schemas checked only whether additionalProperties was present in the schema, not whether its value was a real schema object. This caused schemas with additionalProperties: false (e.g. EntityV3APISpecInterface, a oneOf with strict no-extra-props) to be incorrectly skipped — same as a pure Hash<String, T> map — which is why entity_v3_api_spec_interface.rb was never generated. Fix mirrors the pattern already used in type_to_ruby(): only treat additionalProperties as a map type when its value is not in (None, False). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com> 357fcfa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes a bug in
.generator/src/generator/openapi.pywherechild_models()incorrectly skipped oneOf schemas that declareadditionalProperties: false.Root cause: The guard that excludes pure-map schemas (e.g.
Hash<String, T>) checked"additionalProperties" in schema, which matched both real map schemas and schemas withadditionalProperties: false— a completely different JSON Schema keyword meaning "no extra properties beyond those inproperties". As a result,EntityV3APISpecInterface(aoneOfwithadditionalProperties: falseand noproperties) was silently dropped from the model list and never generated.EntityV3APISpec.openapi_typesalready mapsinterfaceto:'EntityV3APISpecInterface', so the missing file caused aNameErrorat deserialization time whenever that field appeared in a response.Fix: Replace
"additionalProperties" in schemawithschema.get("additionalProperties") not in (None, False)— the same pattern already used intype_to_ruby()in the same file. Only treatadditionalPropertiesas a map type when its value is an actual schema object, not a boolean.This also adds the previously missing
entity_v3_api_spec_interface.rbmodel file and its Zeitwerk inflector entry, both now produced correctly by the fixed generator.Additional Notes
The
pre-commit fixescommit in this branch is from CI running the old (buggy) generator on the first attempt, which deleted the manually added file. The final commit contains the generator fix plus the correctly generated output.Review checklist
This PR includes all newly recorded cassettes for any modified tests.
This PR does not rely on API client schema changes.