Giter Site home page Giter Site logo

Comments (8)

loveyu avatar loveyu commented on May 27, 2024 1

eg: property_id=123&property_id=456

error display:

property_id: 123456

suggest:

property_id: 123
property_id: 456

from james.

loveyu avatar loveyu commented on May 27, 2024 1

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.

from james.

mitchhentges avatar mitchhentges commented on May 27, 2024

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

from james.

loveyu avatar loveyu commented on May 27, 2024

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.

from james.

mitchhentges avatar mitchhentges commented on May 27, 2024

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?

from james.

loveyu avatar loveyu commented on May 27, 2024

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.

from james.

mitchhentges avatar mitchhentges commented on May 27, 2024

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:

  • Make the adjustment so we don't join arrays improperly - so, instead of the output being property_id: 123456, it will be: property_id: [123, 456] (PR #400)
  • Add a library that handles parsing query parameters (not a fan, since the benefit isn't much greater than the first option, and then we're shipping two query parameter parsers in James)
  • The first option, then handle this directly later in #401

from james.

mitchhentges avatar mitchhentges commented on May 27, 2024

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

from james.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.