Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post and Put operations do not match specification #45

Open
Igneous01 opened this issue Nov 28, 2018 · 2 comments
Open

Post and Put operations do not match specification #45

Igneous01 opened this issue Nov 28, 2018 · 2 comments

Comments

@Igneous01
Copy link

Igneous01 commented Nov 28, 2018

This library does not appear to match the hal spec in regards to doing post and put operations.

The examples shown from Spring indicate that the server returns a Resource, but the client is expected to post back the embedded object, and not the Resource. When using this framework and calling a method on a service such as update, it sends back the Resource to the post method, which does not appear to match the specification that Spring is promoting.

example:
GET returns PlayerResource to client
POST client is to return an instance of Player, not PlayerResource

public ResponseEntity < PersonResource > post(@RequestBody final Person personFromRequest) { final Person person = new Person(personFromRequest); personRepository.save(person); final URI uri = MvcUriComponentsBuilder.fromController(getClass()).path("/{id}").buildAndExpand(person.getId()).toUri(); return ResponseEntity.created(uri).body(new PersonResource(person)); }

https://dzone.com/articles/applying-hateoas-to-a-rest-api-with-spring-boot

@sante85
Copy link
Collaborator

sante85 commented Dec 18, 2018

please more details

@sante85
Copy link
Collaborator

sante85 commented Apr 2, 2019

do a pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants