Skip to content

cfn-cli codegen oneOf union types is not handled #242

@dchakrav-github

Description

@dchakrav-github

Updated Issue Description

The issue here is that we initially disallowed having a property be declared as multiple types. For example {"type": ["string", "array"]} was deemed to be invalid. This includes use of combiners (oneOf, anyOf, allOf) to declare multiple types as well.

We then loosened that restriction on the type property in #454, but we did not move the restriction for $ref, causing an inconsistency there


Original Issue Description

When modeling AWS::SQS::Queue, we either have a FIFOQueue or StandardQueue for the type. This can be modeled via oneOf these 2 types. The property sets and property based constraints are different in these 2 sets. E.g. QueueName for FIFOQueue has to end with .fifo$ vs standard one doesn't have this constraint. oneOf semantics of JSONSchema is not handled.

aws-sqs-queue.json.txt

rpdk.core.jsonutils.utils.ConstraintError: Object at path '#' declared multiple values for '$ref': found '('definitions', 'StandardQueue')' and '('definitions', 'FifoQueue')'

rpdk.log

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcodegenIt's like magic!

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions