Skip to content

Documentation is wrong: POST to spring data rest collection endpoint [DATAREST-975] #1297

Open
@spring-projects-issues

Description

@spring-projects-issues

Robert Rackl opened DATAREST-975 and commented

GIVEN a child repository that references a parent repository
AND both repositories are exposed as HATEOAS rest services.
AND the parent repository already contains some rows.

WHEN you know want to ADD another child that references this existing parent,

THEN you send a POST request to the URI, e.g

POST http://localhost:8080/api/parent/1/children

The documentation sais you should send a header application/json. But it does not specifiy the JSON format what to send.

WORKAROUND: You can send a Content-Type: "text/uri-list" and only send the URI of the child you want to add.

curl -X POST -H "Content-Type: text/uri-list" -H "Cache-Control: no-cache" -d 'http://localhost:8090/liquido/v2/users/2' "http://localhost:8090/liquido/v2/ideas/1/supporters"

Suggestion: Update the documentation and specify exaxtly what to send


Reference URL: http://docs.spring.io/spring-data/rest/docs/current/reference/html/#_supported_http_methods

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions