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

[API] Remove items and properties parameters in the /values endpoint #2

Open
ForcamPB opened this issue Dec 5, 2022 · 4 comments
Open

Comments

@ForcamPB
Copy link

ForcamPB commented Dec 5, 2022

The parameters items and properties should be removed to make the endpoint simpler. Instead the item and property query could be used multiple times like /values?item=aaa&item=bbb.

@kenwenzel
Copy link
Member

Thank you for bringing this up.
The support for repetition of HTTP parameters seems to depend on the programming framework:
https://stackoverflow.com/questions/11621477/using-duplicate-parameters-in-a-url

Therefore it may be hard or even impossible to achieve the desired effect in certain environments.

Maybe we could also just allow item and property to contain multiple space-separated values instead of using the plural forms?

@ForcamPB
Copy link
Author

ForcamPB commented Dec 6, 2022

I would favour a solution without the plural form. Because during implementation I was not sure what to do when for example both variants are set. And I couldnt just mark the singular variant as required, because it can be left out when using the plural variant. In the end I merged the singular and plural values and required that at least one value must then be present.

Also it seems to me that most frameworks use comma-separated values and not space separated values. At least comma separation appeared a lot when browsing stack overflow.

E.g. our framework supports multiple appearances of the same parameter and comma-separation out of the box: https://www.baeldung.com/spring-request-param#mapping-a-multi-value-parameter

@kenwenzel
Copy link
Member

kenwenzel commented Dec 6, 2022

I would also opt for the singular forms. But comma separation is not possible as a comma (,) is a valid character within URIs/IRIs.

Related question:
https://softwareengineering.stackexchange.com/questions/386944/unambiguously-represent-separator-in-a-string-containing-an-uri

@ForcamPB
Copy link
Author

ForcamPB commented Dec 7, 2022

In that specific case it doesn't matter if we use , or space for separation. When it comes to special characters the standard is not very distinct. So clients should encode both characters to ensure correctness. , should be encoded with %2C and space with %20 or a +.

So from this perspective it doesn't matter if the encoded URL contains ?item=aaa%2Cbbb or ?item=aaa%20bbb

@kenwenzel kenwenzel changed the title Remove items and properties parameters in the /values endpoint [API] Remove items and properties parameters in the /values endpoint Mar 22, 2024
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