[DOCU-2231] DOC: properties endpoint throws 400 for every POST request Created: 01/Nov/17  Updated: 28/Feb/22  Resolved: 25/Feb/22

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Richard Gange Assignee: Martin DrĂ¡pela
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
depends upon MGNLREST-97 Implement exception handling for rest... Closed
is depended upon by DOCU-1205 Add examples for properties endpoint ... Closed
relation
is related to DOCU-1185 properties endpoint page Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Documentation update required:
Yes
Date of First Response:

 Description   

Using the POST for properties endpoint never works as the value array is always empty on the server side.

Take the example:

curl http://localhost:8080/magnoliaAuthor/.rest/properties/v1/website/travel/title \
  -H "Content-Type: application/json" \
  -X POST -i \
  --user superuser:superuser \
--data \
'{
  "value": [ "Magnolia Travels Home " ]
}'

When I debug the call I see that the bad request comes from:

if (!multiple && valueStrings.size() != 1) {
    return Response.status(Response.Status.BAD_REQUEST).build();
}

valueStrings is always of size 0.



 Comments   
Comment by Richard Gange [ 17/Mar/20 ]

It should be mentioned that it's possible to workaround this issue by simply using the Nodes endpoint to update properties.

Comment by Christopher Chard [ 24/Aug/20 ]

Hi Richard,

see https://jira.magnolia-cms.com/browse/SUPPORT-11698 - Nodes endpoint seems to be pretty much disfunctional, so not a real workaround

Comment by Richard Gange [ 24/Aug/20 ]

Hello cchard-

Sorry, what? This ticket is for one very specific case of the properties endpoint. IMHO this endpoint is redundant anyway. Please see my comment on 11698. The problem there is you did not format your call correctly.

Regards

Generated at Mon Feb 12 01:25:12 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.