Description
Currently pipe parameter validators (p.string(), etc.) don't support constraining values to a set of allowed literals (union/literal types).
This would be useful for parameters like sort order or filter modes where only specific values are valid.
Example
params: {
order: p.string().literals('asc', 'desc'), // type: 'asc' | 'desc'
status: p.string().literals('active', 'inactive', 'pending'),
}
This would provide both TypeScript type safety and runtime validation.
Description
Currently pipe parameter validators (
p.string(), etc.) don't support constraining values to a set of allowed literals (union/literal types).This would be useful for parameters like sort order or filter modes where only specific values are valid.
Example
This would provide both TypeScript type safety and runtime validation.