-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Description
The generated Java API is composed of a bunch of classes each representing a JAX-RS resource. I am ok with this code structure, but I'd like to have an additional class that encapsulate those in order to set once and for all the api key or the base path of the endpoints. It would be something like this:
class Api {
String token, path;
SomeApi getSomeApi(){
return new SomeApi(token, path);
}
SomeOtherApi getSomeOtherApi(){
return new SomeApi(token, path);
}
}
In this way the clients only have to create an instance of Api
with the correct token and base path and that'll get propagated. It's like a giant builder class basically.
Is it possible to write a mustache file that uses each resource and creates these methods? There would obviously be a convention for the constructor.
Metadata
Metadata
Assignees
Labels
No labels