-
Notifications
You must be signed in to change notification settings - Fork 403
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
Improve api consistency #42
Comments
I feared that too many of these combinators might be confusing :) But first, some motivation on why there are two ways to group parameters in the first place. I want to support two scenarios:
Given the tradeoff between less ways to group parameters and supporting the two use-cases above, I pick the second option. However, we might still simplify the usages of |
In the end keeping |
Closing as "won't fix" for the reasons above. Feel free to reopen if you've got new ideas :) |
I wonder if it is a good thing that
Endpoint
has so flexible api, e.g. following case are equivalent:where
limitParameter
is definied as follow:What's even worse, somebody can just type:
which is a pure abomination :)
Doesn't such ambiguity make adoption slower?
In opposite to that I was thinking about something like this:
Where
"list"
and"all"
are both PathParams and only they have this/
method to concatenate with other pathParams. Also there is?
method defined on them which allows joining with queryParams and it changes the object type to queryParam so there is no option to add next pathParams anymore (which in contrary is possible with current api).There are still some things which are unclear with proposed change like:
EndpointInput
multiple times?I made a trashy implementation to better visualize my idea.
From it it seems that it is not a good approach due to sealed traits explosion and duplication.
Maybe it would be better to change
Endoint.in
method to accept some kind of higher abstraction dsl which would be internally converted to oldEndpointInput
structure?See e8795f7
The text was updated successfully, but these errors were encountered: