spring-projects / spring-projects/spring-data-rest

Unable to append to a map [DATAREST-308]

Open
#687 2 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Dec 31, 2020.

in: repository type: bug
Dominant language
Java
Stars
958
Forks
568
PR merge metrics
No merged PRs in 30d

Description

Ian Duffy opened DATAREST-308 and commented

I am unable to append to a map entity through the default PATCH exposed by the rest exporter.

PATCH to the repository with the Content-Type of text/uri-list and a body of
+url-to-resource-to-add does work, however it sets the key on the map to "self"

I have attached a sample application. If you launch it and execute the following you should be able to reproduce

http://localhost:8080/integerAttributes

HTTP Method: POST
Content-Type: application/json
Request Body:

{
"contents": 1
}

http://localhost:8080/mapAttributes

HTTP Method: POST
Content-Type: application/json
Request Body:

{}

http://localhost:8080/mapAttributes/2/contents

HTTP Method: PATCH
Content-Type: text/uri-list
Request Body:

+http://localhost:8080/integerAttributes/1


Affects: 2.0.2 (Codd SR2), 2.1 GA (Dijkstra)

Attachments:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.