fix: enforce additionalProperties:false in generated models - #70
Merged
damaz91 merged 1 commit intoAug 12, 2026
Conversation
damaz91
force-pushed
the
fix/enforce-additional-properties-false
branch
from
August 12, 2026 10:07
4ec2a57 to
590855c
Compare
damaz91
approved these changes
Aug 12, 2026
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.
Description
Three object schemas in the pinned spec declare
additionalProperties: falsewith named properties:types/error_response.json(rootErrorResponse)types/merchant_fulfillment_config.json(allows_multi_destination)types/business_fulfillment_config.json(allows_multi_destination)Generation runs with
--extra-fields=allow, so every generated model wasConfigDict(extra="allow"). Unknown keys were silently retained inmodel_extrainstead of being rejected:Fix: the post-processor scans the preprocessed schemas for objects with
additionalProperties: falseand non-empty namedproperties, maps each to its generated class (roottitleor the nested property path, e.g.allows_multi_destination->AllowsMultiDestination), and flips that class'smodel_configtoextra="forbid". Sibling classes in the same module keepextra="allow".Category (Required)
Related Issues
N/A
Checklist
generate_models.shunder python_sdk (SDK 0.4.x targets UCPrelease/2026-04-08).Screenshots / Logs (if applicable)
./generate_models.sh 2026-04-08: postprocess reportsextra=forbid on 'AllowsMultiDestination'andextra=forbid on 'ErrorResponse'python -m unittest discover -s tests -p 'test_*.py': 67 passedpre-commit run --all-files: passedgit diff --check: passed