Strict query parameter matching
See original GitHub issueif I have this case in my HttpService
object OptionalYearQueryParamMatcher extends OptionalQueryParamDecoderMatcher[Int]("year")
...
case GET -> Root / "temperature" :? OptionalYearQueryParamMatcher(maybeYear) =>
it matches requests like http://localhost/temperature
or http://localhost/temperature?year=1
and that’s fine.
but it also matches http://localhost/temperature?superfluous=someval
or http://localhost/temperature?year=1&superfluous=someval
is there a way to do strict matching on the query parameters that doesn’t allow any superfluous parameters to be present?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Request Matching - WireMock
Stub matching and verification queries can use the following request attributes: URL; HTTP Method; Query parameters; Headers; Basic authentication (a ...
Read more >REST pattern for for query parameters that might be LIKE ...
Hi I'm building a RESTful app and can't find the recommended way to pattern optional fuzzy or LIKE queries. For example a strict...
Read more >Query Parameters and String Validations - FastAPI
The query parameter q is of type Union[str, None] (or str | None in Python 3.10), ... You can define a regular expression...
Read more >Request matching - Basics - Mock Service Worker Docs
* request handlers allows you to match requests by the following criteria: Request method;; Request URL. Query parameters and hashes are removed ...
Read more >Request Handling — Connexion 3.0.dev0 documentation
All you need to do is define the endpoint's parameters with matching ... Connexion can apply strict parameter validation for query and form...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The workaround with the if-guard seems to be sufficient here.
The label literally means request for comments 😃 To get input from users on how this case should be handles so everyone’s happy.