Skip to content

Resource model break when specifying an array with unique: true #97

Description

@rene84

I've noticed when specifying an array with unique: true translates the model into a Set instead of an Array (makes sense)

but then when passing an actual array as example input, the resource provider fails. Consider for example:

        "Tags": {
            "type": "array",
            "maxItems": 50,
            "uniqueItems": true,
            "insertionOrder": false,
            "description": "An array of key-value pairs to apply to this resource.",
            "items": {
                "$ref": "#/definitions/Tag"
            }
        },

with input:

"Tags": [{
            "Key": "name",
            "Value": "value"
        }]

gives error

"message": "Error: Error: Unsupported type: object [Tag] for tags (Error)",

Removing the uniqueItems fixes the issue and the main thing I notice is that in the generated code the type changes from a Set to an Array

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions