Clean up Spring REST Docs examples

This commit is contained in:
David Morley
2016-04-15 05:53:48 -05:00
parent 52728c6ef9
commit 46da6af6ba
11 changed files with 108 additions and 550 deletions
@@ -1,23 +1,23 @@
package com.example;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
import org.springframework.hateoas.ResourceSupport;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
@RestController
@RequestMapping("/api")
public class IndexController {
@RequestMapping(method=RequestMethod.GET)
public ResourceSupport index() {
ResourceSupport index = new ResourceSupport();
index.add(linkTo(MyRestController.class).withRel("notes"));
index.add(linkTo(MyRestController.class).withRel("tags"));
return index;
}
@RequestMapping(method = RequestMethod.GET)
public ResourceSupport index() {
ResourceSupport index = new ResourceSupport();
index.add(linkTo(MyRestController.class).withRel("notes"));
index.add(linkTo(MyRestController.class).withRel("tags"));
return index;
}
}