Skip to content

Fix/enforce additional properties on refs#185

Merged
kilojoules merged 2 commits intoIEAWindSystems:mainfrom
kilojoules:fix/enforce-additional-properties-on-refs
Mar 24, 2026
Merged

Fix/enforce additional properties on refs#185
kilojoules merged 2 commits intoIEAWindSystems:mainfrom
kilojoules:fix/enforce-additional-properties-on-refs

Conversation

@kilojoules
Copy link
Copy Markdown
Collaborator

This fixes a bug that allowed for additional properties in schemas using !ref

kilojoules and others added 2 commits March 3, 2026 13:58
… schemas

_enforce_no_additional_properties only processed the root schema dict
and did not follow $ref links. Schemas loaded via the registry (e.g.
site.yaml, wind_farm.yaml) were never patched with
additionalProperties: false, so extra properties in referenced schemas
passed validation silently.

Use a closure-based retrieve function that applies the enforcement to
referenced schemas when restrictive=True.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verifies that additional properties in schemas loaded via $ref are
rejected when restrictive=True. Without the registry fix, this test
fails because enforcement never reaches referenced schemas.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kilojoules kilojoules requested a review from kenloen March 3, 2026 22:13
Copy link
Copy Markdown
Collaborator

@bayc bayc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this bug @kilojoules !

Copy link
Copy Markdown
Collaborator

@kenloen kenloen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!
Ready to merge to me.

@kilojoules kilojoules merged commit b4c3dfa into IEAWindSystems:main Mar 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants