Skip to content

Add unknown validation state for intrinsic functions in composite validators#4384

Merged
kddejong merged 1 commit intoaws-cloudformation:mainfrom
kddejong:fix/CfnLintJsonSchema/functions
Mar 6, 2026
Merged

Add unknown validation state for intrinsic functions in composite validators#4384
kddejong merged 1 commit intoaws-cloudformation:mainfrom
kddejong:fix/CfnLintJsonSchema/functions

Conversation

@kddejong
Copy link
Copy Markdown
Contributor

@kddejong kddejong commented Mar 6, 2026

  • Add unknown field to ValidationError and unresolvable_function_mode to Context
  • Update composite validators (if, oneOf, anyOf, allOf, not, contains) to propagate unknown errors when functions cannot be resolved
  • Add default function validators in _keywords_cfn.py that return unknown in unresolvable mode, overridden by full function rules at runtime
  • Filter unknown errors in Base.py and CfnLintJsonSchema
  • Return unknown from BaseFn.validate() in unresolvable mode
  • Fix oneOf to collect valid schemas in single pass
  • Add unit tests for unknown handling in all composite validators

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 98.70130% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.55%. Comparing base (0bbabc9) to head (3bbf41e).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
src/cfnlint/rules/jsonschema/CfnLintJsonSchema.py 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4384      +/-   ##
==========================================
+ Coverage   93.54%   93.55%   +0.01%     
==========================================
  Files         418      422       +4     
  Lines       14145    14280     +135     
  Branches     2817     2843      +26     
==========================================
+ Hits        13232    13360     +128     
- Misses        567      569       +2     
- Partials      346      351       +5     
Flag Coverage Δ
unittests 93.55% <98.70%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…idators

- Add unknown field to ValidationError and unresolvable_function_mode to Context
- Update composite validators (if, oneOf, anyOf, allOf, not, contains) to
  propagate unknown errors when functions cannot be resolved
- Add default function validators in _keywords_cfn.py that return unknown
  in unresolvable mode, overridden by full function rules at runtime
- Filter unknown errors in Base.py and CfnLintJsonSchema
- Return unknown from BaseFn.validate() in unresolvable mode
- Fix oneOf to collect valid schemas in single pass
- Add unit tests for unknown handling in all composite validators
@kddejong kddejong force-pushed the fix/CfnLintJsonSchema/functions branch from b47ac48 to 3bbf41e Compare March 6, 2026 18:18
@kddejong kddejong merged commit 09f25d0 into aws-cloudformation:main Mar 6, 2026
18 checks passed
@kddejong kddejong deleted the fix/CfnLintJsonSchema/functions branch March 6, 2026 23:23
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.

2 participants