Skip to content

fix(deserializer): handle array value from uri-template-lite in simple style path params#2801

Draft
b-wulan wants to merge 1 commit into
stoplightio:masterfrom
b-wulan:fix/2026-05-30-simple-style-array-path-param
Draft

fix(deserializer): handle array value from uri-template-lite in simple style path params#2801
b-wulan wants to merge 1 commit into
stoplightio:masterfrom
b-wulan:fix/2026-05-30-simple-style-array-path-param

Conversation

@b-wulan
Copy link
Copy Markdown

@b-wulan b-wulan commented May 30, 2026

uri-template-lite returns string[] (not string) when it parses a comma-separated path param — e.g. matching /codes/123,456 against /codes/{codeIds} yields { codeIds: ["123","456"] }. deserializeArray assumed a plain string and crashed with TypeError: value.split is not a function (reported in #2710).

The fix adds an Array.isArray guard: if the value is already a parsed array, return it directly; otherwise split as before.

…e style path params

When uri-template-lite parses a comma-separated path param (e.g. /codes/123,456
against /codes/{codeIds}), it returns a string[] rather than a string.
deserializeArray assumed a string and crashed with "value.split is not a function".
Guard against the already-parsed array so both shapes are handled correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant