Skip to content
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

Query parameter doesn't support arrays in &openapi3filter.RequestValidationInput #854

Open
brilliant-ember opened this issue Nov 2, 2023 · 1 comment

Comments

@brilliant-ember
Copy link

&openapi3filter.RequestValidationInput doesn't support using urls that have arrays in their query. For example something.com?ids=1 works but something.com?ids=1,2,3 doesn't work. Also putting parentheses or brackets doesn't help.

This is the exact reported error http request is not valid: parameter "ids" in query has an error: path 0: value [1,2]: an invalid integer: strconv.ParseFloat: parsing "[1,2]": invalid syntax

The fix is very simple all you have to do is something like this
strings.Split(strings.Trim(r.URL.Query().Get("ids"), ""), ",")

@podhmo
Copy link
Contributor

podhmo commented Dec 9, 2023

Is this true?

The fix is very simple all you have to do is something like this

https://swagger.io/specification/#parameter-style

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

No branches or pull requests

2 participants