Closed
Description
Given the following decorated parameters on a controller method:
@QueryParam('fields') fields: string[],
@QueryParam('numbers') numbers: number[]
... the behavior of arrays in query parameters is inconsistent. Namely single values are not coerced to an array and the inner values are not coerced or validated against the appropriate type. Some examples:
// GET ?fields=name
// -> ParameterParseJsonError: Value (\"name\") cannot be parsed to JSON
// GET ?fields=foo&fields=bar
console.log(fields) // -> [ "foo", "bar" ]
// GET ?numbers=1&numbers=2
console.log(numbers) // -> [ "1", "2" ] (works, but not deserialized)
Metadata
Metadata
Assignees
Labels
No labels