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

Locations: Create a convention for creating no-value query parameters #24

Closed
mathiasbn opened this issue Jul 8, 2016 · 6 comments
Closed
Assignees
Labels

Comments

@mathiasbn
Copy link

If I want a URL to look like this:
/?novalue

The best I can come up with is:

@Location("/") class SomeLocation private constructor(val novalue:String){
    constructor():this("")
}

Which give:
/?novalue=

@orangy
Copy link
Contributor

orangy commented Jul 19, 2016

How about we instead allow to bind routes to paths like /foo/bar?param=1 or /foo/bar?novalue? It would create a query parameter matching selectors at the end of the route chain.

@mathiasbn
Copy link
Author

Could you give an example? How would you mark it no value?

@orangy
Copy link
Contributor

orangy commented Jul 23, 2016

Something like @Location("/?novalue&value=1")

@mathiasbn
Copy link
Author

mathiasbn commented Aug 15, 2016

Well that could work for some scenarios. It could be annoying if you have 3 possible "novalue", and then need to express 8 different locations. But then again it's difficult to encode everything in the path. "I want novalue with '='", I want without '='", "I want absent optionals to be like novalue", ....

Perhaps it's just better to remove '=' at empty string? Then it's still dynamic.

This is not the most important issue in the world. It's just the representation of the URLs

(Sorry for late reply. Was on vacation)

@stale
Copy link

stale bot commented Sep 24, 2019

This issue has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the stale label Sep 24, 2019
@stale stale bot removed the stale label Mar 24, 2020
@e5l
Copy link
Member

e5l commented Jul 17, 2020

@e5l e5l closed this as completed Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants