[MGNLREST-274] Date types cannot be updated via REST calls Created: 10/Sep/20 Updated: 09/Mar/21 Resolved: 09/Mar/21 |
|
| Status: | Closed |
| Project: | Magnolia REST Framework |
| Component/s: | integration |
| Affects Version/s: | 2.2.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Richard Gange | Assignee: | Richard Gange |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Template: |
|
||||
| Acceptance criteria: |
Empty
|
||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||
| Description |
|
When trying to update a property of type Date via REST I always get the time of the call in the field rather than the passed value. I would expect to be able to update a date property like this (similar to this): curl http://localhost:8080/magnoliaAuthor/.rest/nodes/v1/website/travel \ -H "Content-Type: application/json" \ -X POST -i \ --user superuser:superuser \ --data \ '{ "properties": [ { "name": "title", "type": "String", "values": [ "Hello REST updated" ] }, { "name": "date", "type": "Date", "values": [ "2020-01-01T11:10:00.000+01:00" ] } ] }' Workaround |
| Comments |
| Comment by Richard Gange [ 09/Mar/21 ] |
|
I was able to fix this by using a different format for date: curl http://localhost:8080/magnoliaAuthor/.rest/nodes/v1/website/travel \ -H "Content-Type: application/json" \ -X POST -i \ --user superuser:superuser \ --data \ '{ "properties": [ { "name": "title", "type": "String", "values": [ "Hello REST updated" ] }, { "name": "date", "type": "Date", "values":["2020-05-01T12:11:25"] } ] }' |