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
Is your feature request related to a problem? Please describe.
When using useSingleRequestParameter = true for WebClient and RestClient, the SingleReqestParameter model only has an AllArgsConstructor. Thus a caller has to do new RequestModel(param1, null, null, null, null) if the endpoint has 5 parameters but only the first one is relevant for the usecase.
It would be beneficial if the request model supported the same type of object instantiation as the general POJO model offers.
This so that it is easy to only interact with the parameters that are relevant.
E.g., we generate an api-model for an api that has 5 parameters, for that I would with the current model need to state new DeletePetRequest(param1, null, null, null, null).
Whereas with the POJO approach above we would only do new DeletePetRequest().parameter1(param1).
This also makes it so that if the api adds new parameters then we are not forced to act on them (e.g., they add a sixth optional parameter, and I have to change the code from new DeletePetRequest(param1, null, null, null, null) to new DeletePetRequest(param1, null, null, null, null, *null*).
Instead we do not need to do anything with the POJO approach. We only need to adjust it if it is the case that we want to utilize the new parameter. This would then be done with new DeletePetRequest().parameter1(param1).*parameter6(param6)*.
My current idea is to build upon the functionality introduced with this PR, and introduce so that the "static" value would both affect the RestClient and the WebClient in the same way. This in an attempt to bring the two Spring-clients closer to each other. The goal in the long term being that "static" would become the go to solution since it will be a superset of "true".
The text was updated successfully, but these errors were encountered:
I'm also looking forward for this feature, since we also deal with APIs with many request parameters of which only a few needs to be set. The modification to setter parameter constructor is a great start. Another optimization would be to enhance the config option generateBuilders, so when used with useSingleRequestParameter, builders are generated for the single request parameter classes.
Is your feature request related to a problem? Please describe.
When using
useSingleRequestParameter = true
for WebClient and RestClient, the SingleReqestParameter model only has an AllArgsConstructor. Thus a caller has to donew RequestModel(param1, null, null, null, null)
if the endpoint has 5 parameters but only the first one is relevant for the usecase.It would be beneficial if the request model supported the same type of object instantiation as the general POJO model offers.
This so that it is easy to only interact with the parameters that are relevant.
E.g., we generate an api-model for an api that has 5 parameters, for that I would with the current model need to state
new DeletePetRequest(param1, null, null, null, null)
.Whereas with the POJO approach above we would only do
new DeletePetRequest().parameter1(param1)
.This also makes it so that if the api adds new parameters then we are not forced to act on them (e.g., they add a sixth optional parameter, and I have to change the code from
new DeletePetRequest(param1, null, null, null, null)
tonew DeletePetRequest(param1, null, null, null, null, *null*)
.Instead we do not need to do anything with the POJO approach. We only need to adjust it if it is the case that we want to utilize the new parameter. This would then be done with
new DeletePetRequest().parameter1(param1).*parameter6(param6)*
.My current idea is to build upon the functionality introduced with this PR, and introduce so that the "static" value would both affect the RestClient and the WebClient in the same way. This in an attempt to bring the two Spring-clients closer to each other. The goal in the long term being that "static" would become the go to solution since it will be a superset of "true".
The text was updated successfully, but these errors were encountered: