-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 9.10
-
Component/s: Core
-
Release Notes Summary:Multi-valued blob property can be updated via REST API.
-
Tags:
-
Backlog priority:700
-
Sprint:nxcore 10.2.3
-
Story Points:5
The problem can be reproduced by using this curl command, even if no blob has been previously uploaded using the batch API.
After running
curl 'http://localhost:8080/nuxeo/api/v1/path/default-domain/UserWorkspaces/Administrator?' -u Administrator:Administrator -H 'X-NXenrichers.document: permissions, subtypes' -H 'nx_es_sync: true' -H 'enrichers-document: permissions, subtypes' -H 'Content-Type: application/json' -H 'accept: text/plain,application/json, application/json' -H 'X-NXDocumentProperties: *' -H 'Nuxeo-Transaction-Timeout: 30000' --data-binary '{"entity-type":"document","type":"File","name":"QSDQSD","properties":{"dc:title":"QSDQSD","dc:description":"","files:files":[{"upload-batch":"batchId-055878bb-4458-48c1-b51b-086e02254b20","upload-fileId":"0"}]},"parentRef":"4c6504ef-bff8-48ee-a4bf-4a0f4109bce1"}'
the following error is thrown
11:13:25,002 WARN [WebEngineExceptionMapper] Exception in JAX-RS processing org.nuxeo.ecm.core.api.model.PropertyNotFoundException: segment 0 cannot be resolved, files/0/file at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.getProperty(DocumentModelImpl.java:1390) at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.getPropertyValue(DocumentModelImpl.java:1440) at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonReader.avoidBlobUpdate(DocumentModelJsonReader.java:164) at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonReader.avoidBlobUpdate(DocumentModelJsonReader.java:171) at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonReader.avoidBlobUpdate(DocumentModelJsonReader.java:177) at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonReader.avoidBlobUpdate(DocumentModelJsonReader.java:155) at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonReader.applyPropertyValues(DocumentModelJsonReader.java:183) at org.nuxeo.ecm.restapi.server.jaxrs.JSONDocumentObject.doPost(JSONDocumentObject.java:99)
It seems that the documentPart which corresponds to the ListProperty is not "correctly" initialized or cannot be iterated by giving an index.
This prevents from updating a multi-valued blob property.