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

Return errors for unrecognized query parameters #27

Open
lindholc opened this issue Aug 19, 2018 · 1 comment
Open

Return errors for unrecognized query parameters #27

lindholc opened this issue Aug 19, 2018 · 1 comment

Comments

@lindholc
Copy link
Member

According to the spec, a query with unrecognized parameters "should" (RFC 2119) return an error.

I wasn't able to figure out a way to do this when working on #9. Rather than spend more time on something that isn't strictly required, here's a ticket to consider figuring this out later.

@lindholc
Copy link
Member Author

I've thought of an unpleasant way of doing this.

case GET -> Root / "hapi" / "info"
    :? IdMatcher(id)
    +& ParamMatcher(params)
    +& query => ???

query will be a Map[String, Seq[String]] mapping parameters to their values for the whole query. One could check the keys and return an error if any of the keys aren't the sanctioned ones.

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

1 participant