prism icon indicating copy to clipboard operation
prism copied to clipboard

Tuple respones type causes error in Prism dynamic mode

Open PaulKiddle opened this issue 6 months ago • 0 comments

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.

PaulKiddle avatar Jun 27 '25 14:06 PaulKiddle