Open
Description
Hello,
Let's consider the following controller:
@RequestMapping("/foos")
public class FooController {
@GetMapping
public ResponseEntity<?> list() {
return ResponseEntity.ok(
new CollectionModel<>(
Collections.emptyList(),
selfLink.andAffordance(
afford(
methodOn(FooController.class).create(null)))));
}
@PostMapping
public ResponseEntity<?> create(@RequestBody CreateCommand command) {
//...
}
private static class CreateCommand {
private final String name;
@JsonCreator
CreateCommand(@JsonProperty("name") String name){
this.name = name;
}
}
}
FooController#list
produces:
{
"_links": {
"self": {
"href": "http://localhost:8080/foos"
}
},
"_templates": {
"default": {
"method": "post",
"properties": []
}
}
}
As you can see, property name
is missing.