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

Can't use DTO for by-name params with RequestBuilder #70

Open
dttrian opened this issue Mar 17, 2021 · 0 comments
Open

Can't use DTO for by-name params with RequestBuilder #70

dttrian opened this issue Mar 17, 2021 · 0 comments

Comments

@dttrian
Copy link

dttrian commented Mar 17, 2021

I'd like to model the params of my requests as DTOs and used them to populate the params of JSON RPC requests.
For example if I define this DTO:

class PlayerCreationDTO {
    String firstName;
    String lastName;
}

I would like to do something like this:

PlayerCreationDTO playerCreationDTO = new PlayerCreationDTO();

...

Player player = client.createRequest()
        .method("findByInitials")
        .id(43121)
        .paramsByName(playerCreationDTO)
        .returnAs(Player.class)
        .execute();

It doens't work because the paramsByName method does not exist (of course).
There exists a params method but it implements params "by-position" and not "by-name".

Is there a way to achieve what I want with the current version of the library?

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

1 participant