Skip to content

Commit bedfdc2

Browse files
authored
Force resolve validation to not use strict types (#3488)
1 parent d851112 commit bedfdc2

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/cfnlint/rules/functions/_BaseFn.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ def resolve(
6363
key, _ = self.key_value(instance)
6464

6565
return_err: ValidationError | None = None
66+
validator = validator.evolve(
67+
context=validator.context.evolve(
68+
strict_types=False,
69+
),
70+
)
6671
for value, v, resolve_err in validator.resolve_value(instance):
6772
if resolve_err:
6873
yield resolve_err

test/unit/rules/functions/test_basefn.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ def rule():
2727
[],
2828
),
2929
("Everything is fine", {"Fn::Sub": "Foo"}, {"enum": ["Foo"]}, []),
30+
(
31+
"Resolved Fn::Sub has no strict type validation",
32+
{"Fn::Sub": "2"},
33+
{"type": ["integer"]},
34+
[],
35+
),
3036
(
3137
"Standard error",
3238
{"Fn::Sub": "Bar"},

0 commit comments

Comments
 (0)