422 Client Error: Unprocessable Content for url

Using the REST API, I am seeing behavior that I am unable to pin down. I can work around it but wanted to ask the question.

  1. I use GET to retrieve an item which in this case has a Mapping Marker.

  2. I insert a new property to this item.

  3. I use PUT to replace the item and get the 422 error.

  4. If I removed the mapping marker from the Item, and then PUT, I do not get the 422.

  5. If I remove the mapping marker from the Item and then PATCH, I do not get the 442.

Below, I paste in an example of what is coming back from Omeka-S from the GET of an item I added via the REST API and then below it from one I added via the Omeka add-item interface – they appear the same to me.

‘o-module-mapping:marker’: [{‘@id’: ‘http://localhost/omeka/api/mapping_markers/9653’, ‘o:id’: 9653}]

‘o-module-mapping:marker’: [{‘@id’: ‘http://localhost/omeka/api/mapping_markers/10616’, ‘o:id’: 10616}]

In this case, 422 is a validation error. Are you getting an error message? Try this: instead of passing the incomplete marker output of an item GET, include the full marker output from its API endpoint. So, for example:

'o-module-mapping:marker': [
    // output of http://localhost/omeka/api/mapping_markers/9653,
    // output of http://localhost/omeka/api/mapping_markers/10616