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

Partial update via PATCH ignores custom date format expressed through @JsonFormat [DATAREST-1214]

Open
#1,524 0 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

Jan Zyka opened DATAREST-1214 and commented

Having entity with java.sql.Timestamp field annotated with @JsonFormat.

When creating new one using POST the custom format is recognised and used.
When doing partial update using PATCH, Content-type: application/json-patch+json the update fails with:

...
"message":"Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]"}

When parsing the value update falls back to Timestamp.valueOf(...) and ignores the @JsonFormat


Affects: 2.6.10 (Ingalls SR10), 3.0.5 (Kay SR5)

Reference URL: https://github.com/janzyka/spring-json-patch

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.