-
Notifications
You must be signed in to change notification settings - Fork 212
Multiple entries of the same query parameter are encoded using ; (semicolon) #842
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
Comments
Hi @perlun, joining multiple values using a symbol for a query is not a permanent solution, we prefer to implement what you suggest as well:
We thought about this before, and the value field is an interface type in the data model, so that it can be an array. There will be matcher types that are specific to array values, like |
@tommysitu Sounds great! As noted, it's not a huge problem for me at the moment but it was just something we discovered internally when we figured out how it's currently serialized to the JSON. Btw, thanks for a great product! 👍 |
Hi, is this fixed? Or some way working with queries like: |
@tommysitu I can work on this issue and fix this in above mentioned way. You can assign this issue to me. |
@kapishmalik that'll be awesome! |
@tommysitu Work is in progress. Can you mark this as WIP or assign this issue to me? |
@tommysitu Raised PR |
Thanks @kapishmalik your PR looks good! |
@tommysitu I feel I need to relook at contains and containsonly matcher. I am confused with existing implementation. I will raise PR to fix those. |
@tommysitu can you check this PR and review implementations and if they make more sense now. |
Thanks @tommysitu with reviews. I believe we are good with this issue now. |
@perlun this is done. You can use and let us know inase of any issues. |
Description of the bug
In commit 1276c03 (PR #794), we fixed #792. However, the fix is still not optimal since query parameters where either part of the
key=value
part includes semicolon will be unable to be represented in the simulation JSON.To be honest, my use case don't have a requirement to use semicolons at the moment. However, I see a risk with the current implementation in that it uses a separator which could potentially be a fully valid part of a query parameter for a "reserved" purpose like this. This could potentially be very confusing to our users.
Ideally, the values would be present multiple times in the JSON (i.e. no separator), but if this is considered too complex/time consuming, we should at the very least choose a separator which is more than a single character.
;;;
would be an improvement (note, this is just a suggestion; feel free to come up with a better option if you like)Steps to reproduce the issue
Make a query which includes the same query string multiple times.
Like this: http://localhost/some-api/some-resource?q=access:vod&q=order:latest&q=profile:vd
Observed result
Hoverfly error messages seen (If none, say none)
If possible, add screenshots to help explain your problem
Expected result
or (preferably):
or even this (I think this would be my personal favorite, in terms of readability of the JSON):
Additional relevant information
The text was updated successfully, but these errors were encountered: