Skip to content

Commit

Permalink
Fix type checking in if/then
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong committed Jul 4, 2024
1 parent 292a25c commit 7ba42e8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,42 @@
]
},
"then": {
"if": {
"properties": {
"Cpu": {
"type": [
"string",
"integer"
]
}
},
"required": [
"Cpu"
]
},
"not": {
"required": [
"PlacementConstraints"
]
},
"properties": {
"Cpu": {
"enum": [
256,
512,
1024,
2048,
4096,
8192,
16384
]
}
},
"required": [
"Cpu",
"Memory"
]
],
"then": {
"properties": {
"Cpu": {
"enum": [
256,
512,
1024,
2048,
4096,
8192,
16384
]
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ def rule():
)
],
),
(
{
"RequiresCompatibilities": ["FARGATE"],
"Cpu": {"Ref": "MyParameter"},
"Memory": "512",
},
[],
),
(
{
"RequiresCompatibilities": ["FARGATE"],
Expand All @@ -87,7 +95,7 @@ def rule():
rule=TaskFargateProperties(),
path=deque(["Cpu"]),
validator="enum",
schema_path=deque(["then", "properties", "Cpu", "enum"]),
schema_path=deque(["then", "then", "properties", "Cpu", "enum"]),
)
],
),
Expand Down

0 comments on commit 7ba42e8

Please sign in to comment.