How can I configure Google Cloud Endpoints to ignore specific methods during API generation ?
I want to expose some methods (but not all) of my FooServiceImpl service as a Cloud Endpoints API. With an @Api annotation on my FooServiceImpl, Google Cloud Endpoints try to expose ALL public methods (and fails if response class is not OK).
How can I have a public method in my service that Cloud Endpoints will not try to expose in the API ?
A solution would be to have two service classes :
FooServiceImpl, that contains implementation method
FooServiceApi, that contains only API-exposed methods and each method calls its implementation in FooServiceImpl
But this is a not-ideal and verbose solution, it means we have two classes for each service, with very similar code...
Class methods appear in the API surface if:
@ApiMethod.public and follow a naming convention for a RESTful method name (replace Resource with the name of your JavaBean):
getResourceinsertResourceupdateResourcelistResourceremoveResourceThe off-the-cuff recommendation is to make the methods you don't want in the public API private in your class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With