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

Type checking of URL queries is too strict #30

Open
hectorj opened this issue May 29, 2017 · 2 comments
Open

Type checking of URL queries is too strict #30

hectorj opened this issue May 29, 2017 · 2 comments

Comments

@hectorj
Copy link

hectorj commented May 29, 2017

See the failing test in #29

Because parse_str is used on the query string, all query parameters are considered to be strings.

Is there currently a way to have a PSR7 Request matching a int type on a query parameter?

@hectorj
Copy link
Author

hectorj commented May 29, 2017

And to answer the "query string only support strings": both the Swagger specification documentation and the fixture schema used in this repo seems to consider it valid.

So there should be a way to validate it.

I've tried upgrading the justinrainbow/json-schema dependency to be able to use some loose type check, but I haven't gotten it to work yet with all the BC breaks the upgrade brings.

@francescozanoni
Copy link

Hi,
according to https://github.com/justinrainbow/json-schema#type-coercion, values sent via HTTP query string (and headers, I suppose) can be correctly managed by this library, at least since Oct 2016.
Couldn't this fix the issue?
Thanks!

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