-
Bug
-
Resolution: Done
-
Major
-
3.1.1.Final
-
None
Create node using POST method fails when request data contains jcr:mixinTypes="..." after attributes it declares. Below is sample curl which fails, quark:contact doesn't allow to insert any attributes, so quarkmix:contactPostalAddress must be mixed to store street name:
curl -XPOST -HContent-type:application/json --data "{\"quark:type\":\"POSTAL_ADDRESS\",\"jcr:title\":\"Address\",\"quark:street\":\"The Street\",\"jcr:mixinTypes\":[\"quarkmix:contactPostalAddress\"],\"jcr:primaryType\":\"quark:contact\"}" http://localhost:8080/modeshape-rest/myrepo/default/items/foo
And valid one - same except jcr:mixinTypes has been moved before mentioned attributes it declares - creates node without any problem:
curl -XPOST -HContent-type:application/json --data "{\"quark:type\":\"POSTAL_ADDRESS\",\"jcr:title\":\"Address\",\"jcr:mixinTypes\":[\"quarkmix:contactPostalAddress\"],\"quark:street\":\"The Street\",\"jcr:primaryType\":\"quark:contact\"}" http://localhost:8080/modeshape-rest/myrepo/default/items/foo
Mixin is defined as:
[quarkmix:contactPostalAddress] mixin - quark:street (STRING) COPY - quark:streetNumber (STRING) COPY - quark:apartment (STRING) COPY - quark:zipCode (STRING) COPY - quark:city (STRING) COPY - quark:province (STRING) COPY - quark:country (STRING) COPY
Best regards.