Commit b7137c5
authored
fix(cfn2ts): correctly choose between string and object without required properties in a union (#12954)
In our code generation, in the validation functions for CFN complex types,
we never checked whether the argument we received is an object.
Because of that, passing a string was actually a correct candidate for a union with a complex type that had no required properties.
Fix that by checking for that error explicitly,
which removes the complex type without required properties from the candidates for the union type when a string is passed.
Fixes #12854
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*1 parent 50e597b commit b7137c5
File tree
3 files changed
+36
-0
lines changed- packages/@aws-cdk/aws-sam/test
- tools/cfn2ts/lib
3 files changed
+36
-0
lines changedFile renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
687 | 696 | | |
688 | 697 | | |
689 | 698 | | |
| |||
0 commit comments