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

JSON view on response should let us know if there are duplicate fields in the JSON #1461

Open
sgazzard-meetup opened this issue Dec 9, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@sgazzard-meetup
Copy link

Description

We had an issue where we were decoding a JSON object, we were getting a different value than what we were seeing in Proxyman. Our JSON response was shown as having

    "value": true

but our decoded object had

value: false

We eventually discovered that our JSON actually had a bug, and was:

    "value": false,
    "value": true

Proxyman was only showing one instance of "value", even though there were two in the JSON, and our decoding was catching the first value.

After we found this, we were eventually able to determine that if we looked at the 'RAW' view of the request, we saw the duplicate field.

Why this feature/change is important?

Proxyman is our first go-to when we have unexpected interactions with the API. In prettifying the JSON, it lost important information that would have made debugging the issue much easier

@sgazzard-meetup sgazzard-meetup added the enhancement New feature or request label Dec 9, 2022
@NghiaTranUIT NghiaTranUIT self-assigned this Dec 10, 2022
@NghiaTranUIT
Copy link
Member

Thanks for the detailed reports.

Not sure if it's possible to prevent duplicated keys in the JSON Object when performing the JSON Prettifier.

Proxyman is using this library: https://github.com/nlohmann/json

This issue is discussed but the feature "Allow nonunique keys" is no longer supported.

I will research and see other JSON libs has this feature, then we can switch to the new one 👍

@sgazzard-meetup
Copy link
Author

Thanks for taking the time to respond!

Even if the prettified JSON can't show it, if there was a message somewhere saying "This JSON has duplicate keys. View raw to see full JSON response" would be helpful in cases like this.

@NghiaTranUIT
Copy link
Member

Thanks. We might implement this warning soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants