You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Continuing a conversation with @andymc12 from Gitter channel)
I would like to create requests with default data with no extra parameters. Headers are already provided with RegisterClientHeaders but QueryParam and actual JSON payloads are not implemented:
e.g
// instead of
@Get("/")
SomeObject fetchItems(@QueryParam("asd") String myParam);
// use something like:
@Get("/")
@DefaultQueryParam(name="asd", value="my-val")
SomeObject fetchItems();
// or:
@Get("/")
@RegisterClientParams(QueryParamsProvider.class)
SomeObject fetchItems();
// or some other idea =)
Same thing goes for actual json payload
The text was updated successfully, but these errors were encountered:
Given we cannot find the Gitter history, could you explain more some more details of the issue? Would using something like @QueryParam("asd") @DefaultValue("my-val") not work here?
Hi @jamezp.
I think that @DefauleValue("my-val") would partially help.
When I originally posted on Gitter, @andymc12 said that it is not portable and not part of the standard. I'm not sure if it is now.
Here's a link to the Gitter history
If I understand what I meant, since it was a long time ago - I suggested 2 options:
Simple way with @DefaultValue or @DefaultQueryParam
I think it's like RegisterHeaderParams where there's a class that can somehow calculate the required data and return it to the function. Not sure when I would use it though 🤷🏼♂️
Would be awesome to do the same thing for payload as well
At that time, as far as I remember, I needed to set the headers, query params, payload, path params in one single function call. It created a telescopic function. Also, most of the time, I needed the same things over and over again, so writing them down in several places in my code just didn't look good.
So I had to wrap it with another client, and I think it just beats the purpose of creating a standard way of handling REST clients
(Continuing a conversation with @andymc12 from Gitter channel)
I would like to create requests with default data with no extra parameters. Headers are already provided with
RegisterClientHeaders
butQueryParam
and actual JSON payloads are not implemented:e.g
Same thing goes for actual json payload
The text was updated successfully, but these errors were encountered: