-
Notifications
You must be signed in to change notification settings - Fork 563
Description
Doogiemuc opened DATAREST-1327 and commented
The spring-data-rest doc sais:
Controllers annotated with
@RepositoryRestControllerare served from the API base path defined inRepositoryRestConfiguration.setBasePath, which is used by all other RESTful endpoints (for example,/api).
This is not true.
@RepositoryRestController
public class MyCustomController {
@RequestMapping(value = "/myCustomResource")
public ResponseEntity<?> customResource() { ... }
}is not mapped at all.
One MUST use a @RequestMapping on class level. Even @RequestMapping("/") works to map MyCustomController. See also https://stackoverflow.com/questions/38607421/spring-data-rest-controllers-behaviour-and-usage-of-basepathawarecontroller
There is a workaround:
@RepositoryRestController
@RequestMapping("${spring.data.rest.base-path}")
public class MyCustomController { ... }At least update the documentation to describe this correctly
Reference URL: https://stackoverflow.com/questions/38607421/spring-data-rest-controllers-behaviour-and-usage-of-basepathawarecontroller
1 votes, 4 watchers