Repository navigation
Avoid maxProperties warnings for single-property schemas - #4686
Merged
kddejong merged 1 commit intoSep 9, 2026
Merged
Conversation
kddejong
approved these changes
Sep 9, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4686 +/- ##
==========================================
- Coverage 94.64% 94.63% -0.02%
==========================================
Files 433 433
Lines 15512 15514 +2
Branches 3011 3012 +1
==========================================
Hits 14682 14682
- Misses 453 454 +1
- Partials 377 378 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Suppress the
I3010approaching-limit child rule when a schema hasmaxProperties: 1.Why
A schema with a one-property maximum has no useful "approaching the limit" state: any valid one-property object is already at 100% of the limit. That causes noisy
I3010matches for one-of style schemas such asAWS::Logs::Transformerprocessors, where each processor object intentionally has exactly one key.The real
E3010overflow behavior is unchanged: objects with more than the allowed number of properties still fail before this guard.Fixes #4684.
Validation
.venv/bin/python -m pytest test/unit/rules/jsonschema/test_max_properties.py -q.venv/bin/python -m pytest test/unit/rules/jsonschema -q.venv/bin/ruff check src/cfnlint/rules/jsonschema/MaxProperties.py test/unit/rules/jsonschema/test_max_properties.py.venv/bin/ruff format --check src/cfnlint/rules/jsonschema/MaxProperties.py test/unit/rules/jsonschema/test_max_properties.pygit diff --checkNote: I attempted a CLI smoke test with the issue's
AWS::Logs::Transformertemplate, but my local schema cache did not include that resource and enhanced schema refresh failed on local SSL certificate verification. The focused jsonschema tests cover the rule path directly.