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

"Request Query Params" use multiple parameters to display errors #399

Closed
loveyu opened this issue Dec 19, 2018 · 8 comments
Closed

"Request Query Params" use multiple parameters to display errors #399

loveyu opened this issue Dec 19, 2018 · 8 comments

Comments

@loveyu
Copy link

loveyu commented Dec 19, 2018

No description provided.

@loveyu loveyu changed the title "Request Query Params "Request Query Params" use multiple parameters to display errors Dec 19, 2018
@loveyu
Copy link
Author

loveyu commented Dec 19, 2018

eg: property_id=123&property_id=456

error display:

property_id: 123456

suggest:

property_id: 123
property_id: 456

@mitchhentges
Copy link
Member

In the case of multiple query parameters with the same name, they're in more of an array form.
I'm thinking of having this print like:

property_id: 123,456

@loveyu
Copy link
Author

loveyu commented Dec 22, 2018

We came across a situation where the passed arguments are of the form but not an array.

property_id=19248&property_id=20321

NOT Like:

property_id[]=19248&property_id[]=20321

If I use array form, I won't be able to pass parameter validation, this is limited by third-party APIs.

However, this is just a display issue and does not cause any exceptions.

@mitchhentges
Copy link
Member

Ah, yes, I understand, I didn't explain properly.
I mean, if you have a URL like: http://website.com/endpoint?property_id=123&property_id=456, then I want to display it like:

property_id: 123,456

Does that sound good?

@loveyu
Copy link
Author

loveyu commented Dec 22, 2018

I feel like referring to the Chrome browser example, https://www.example.com/?property_id=123&property_id=456&property_ids[]=789&property_ids[A]=000

Display:

property_id: 123
property_id: 456
property_ids[]: 789
property_ids[A]: 000

When the array becomes multi-dimensional, the situation may be more complex if merged display is used.

@mitchhentges
Copy link
Member

mitchhentges commented Dec 22, 2018

Hmm, good point.
Right now, our underlying proxy that provides us the data is the tool that parses the query parameters, as viewed in the docs here. It's the underlying proxy that handles ?property_id[0]=123&property_id[1]=456 and ?property=123&property=456 differently:

// hoxy
// ?property_id[0]=123&property_id[1]=456
{
    'property_id[0]': 123,
    'property_id[1]': 456
}

// ?property=123&property=456
{
    'property_id': [123, 456]
}

We have a couple solutions to this:

@loveyu
Copy link
Author

loveyu commented Dec 22, 2018

Display to property_id: [123, 456], the most direct solution. I think the first thing is not to be misleading, the display mode can be flexible.

@mitchhentges
Copy link
Member

I've made a follow-up for this ticket, but since the core issue has been addressed, I'll close this.

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