-
Type: Bug
-
Status: Resolved
-
Priority: Critical
-
Resolution: Fixed
-
Affects Version/s: 10.10-HF58, 2021.15
-
Fix Version/s: 10.10-HF63, 2021.22
-
Component/s: Rest API
-
Release Notes Summary:REST API updates correctly multivalued Integer properties.
-
Tags:
-
Backlog priority:1,000
-
Sprint:nxplatform #63
-
Story Points:3
Steps to reproduce
1. Define a multivalued integer property
2. Try to create a document with this property, e.g
curl -X POST -H 'Content-Type: application/json' -u Administrator:Administrator -d '{"entity-type": "document", "name": "Test File", "type": "File", "properties": {"dc:title": "Test File", "test:test":[1234, 12345, 12345678]}}' http://localhost:8080/nuxeo/api/v1/path/default-domain/workspaces/WS1
Expected Results: The document is successfully created
Actual Results: The following error is received
2022-05-26T10:56:22,360 ERROR [http-nio-0.0.0.0-8080-exec-16] [org.nuxeo.ecm.webengine.app.WebEngineExceptionMapper] java.lang.ArrayStoreException: arraycopy: element type mismatch: can not cast one of the elements of java.lang.Object[] to the type of the destination array, java.lang.Long java.lang.ArrayStoreException: arraycopy: element type mismatch: can not cast one of the elements of java.lang.Object[] to the type of the destination array, java.lang.Long at java.util.ArrayList.toArray(ArrayList.java:433) ~[?:?] at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertiesJsonReader.castArrayPropertyValue(DocumentPropertiesJsonReader.java:189) ~[nuxeo-core-io-10.10-HF59.jar:?] at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertiesJsonReader.fillScalarProperty(DocumentPropertiesJsonReader.java:176) ~[nuxeo-core-io-10.10-HF59.jar:?]
Note that changing the above multivalued property to
"test:test":["1234", "12345", "12345678"]
allows the document to be created successfully.
The request with integers works in HF56 but fails in HF58 and later. I think that it's a regression from NXP-30806
- is caused by
-
NXP-30806 Fix REST API when setting an Integer property with a String value which can be parsed as an Integer
- Resolved