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

Create central router for requests #61

Open
tonowie opened this issue Jun 1, 2019 · 1 comment
Open

Create central router for requests #61

tonowie opened this issue Jun 1, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@tonowie
Copy link
Contributor

tonowie commented Jun 1, 2019

at the moment it is difficult to tell which endpoint is used where and validate that all endpoints are available in the API.

Come up with mechanism that allows

  • central definition of request routing
  • string substitution to use directly openapi definitions
  • lookup of "where do I call this route"
  • assess whether all defined routes are implemented
@tonowie
Copy link
Contributor Author

tonowie commented Jun 1, 2019

could use enum
client.get(Router.GET_BLOCK.with(height))

or perhaps even better use static fields that could each have different implementation, allowing for forced API (types and counts of arguments)

public class Router {
   public static final GetByOneArgument<BigInteger> GET_BLOCK = new GetByOneArgument<>("/block/{height}", "{height}");
}

or build the request reactivex style?

client.get(Routes.GET_BLOCK).withHeight(BigInteger.ONE)...

@tonowie tonowie added the enhancement New feature or request label Jun 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant