@ApiMethod complicated route routing

Is it possible to use the endpoint path parameter in the form of JAX-RS

Tried to use the same approach:

@ApiMethod(name="get.regex", httpMethod=HttpMethod.GET, path="{var:.*}/stuff") public Book getRegEx(@Named("var") String sections) { return new Book(); } 

but causes

 java.lang.IllegalArgumentException: Error while processing method {var:.*}/stuff in API test VERSION v1 Error while processing method {var:.*}/stuff in API test VERSION v1 

I need this to implement relational navigation, for example:

 http://api.example.com/section1/section2/.../section_N 
+6
source share
1 answer

Here is all you can do with @Named annoation (at least everything that has been exhibited). https://developers.google.com/appengine/docs/java/endpoints/paramreturn_types Do you have a limited number of sections? If so, you can create an endpoint for each of the cases.

You can also redesign your architecture. Are you using relational navigation for your Api, or is it a website / front-end hosted by App Engine?

Greetings

0
source

Source: https://habr.com/ru/post/957683/


All Articles