-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array of query parameters #441
Comments
I see. Yeah, the problem is the query parameters are first parsed onto a javascript object (by the The solution that comes to my mind is to adjust the internal request parser in For now, you can probably use the union in your code. Unfortunately, it will not solve the wrong visualisation in the swagger UI. export const GetManyUsersRequest = {
query: Schema.struct({
id: Schema.union(Schema.array(IdUserSchema), IdUserSchema)
}),
}; |
it should be noted that tuples also need to be taken into account |
@sukovanej I think better not to wrap user's schema, but wrap query-element into single array if users schema implies this. otherwise in case of error user will get unexpected parse error - he enters one schema but errors from wrapper one |
Should be solved by the new |
Single query parameter must be treated as single element array for appropriate schema.
Return 400 for GET
/users?id=123
But 200 for GET
/users?id=123&id=456
I have tried
Schema<string[], string>
for123 -> [123]
but it breaks swagger UI - it renders string input instead of several inputs for array of stringsThe text was updated successfully, but these errors were encountered: