Skip to content

Tuple respones type causes error in Prism dynamic mode #2705

@PaulKiddle

Description

@PaulKiddle

I have the following property in one of my OpenAPI resources:

                    "aspectRatio": {
                        "type": "array",
                        "examples": [
                            [
                                "16",
                                "9"
                            ]
                        ],
                        "prefixItems": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "string"
                            }
                        ],
                        "minItems": 2,
                        "maxItems": 2,
                        "additionalItems": false
                    },

This represents a tuple of exactly two strings, such as ["16", "9"].

When I try to access this resource on the server I get the following error:

Request terminated with error: Error: missing items for {
  "type": "array",
  "examples": [
    {
      "0": "16",
      "1": "9"
    }
  ],
  "prefixItems": [
    {
      "type": "string"
    },
    {
      "type": "string"
    }
  ],
  "minItems": 2,
  "maxItems": 2,
  "additionalItems": false
} in /items/0/properties/show/properties/trailer/properties/aspectRatio

Expected Behavior

This should generate a tuple with two strings.

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