When trying to update the subjects field via PATCH, we're getting a __getitem__ AttributeError (500 status).
Based on Plone REST API documentation:
- PATCH requests should work with field names directly:
{"field_name": value} - The Subject field in Plone is a special field (KeywordIndex)
- Some Plone REST API versions may handle Subject differently
{"Subject": subjects}- Standard Plone field name (capital S){"subjects": subjects}- Lowercase as it appears in response{"subjects": tuple(subjects)}- Matching tuple format@contentendpoint - Not available (404)@fields/subjectendpoint - Not available (404)- Full item update - Same error
- POST to @content - Not available (404)
The __getitem__ AttributeError suggests:
- Server-side code is trying to access
data['some_key'] - But
datais not a dict or doesn't have that key - This could be a serializer issue on the server side
- Custom Serializer: The site might have a custom serializer that expects a different format
- API Version: Older/newer Plone REST API versions might handle Subject differently
- Field Not Updatable: Subject field might not be updatable via REST API on this site
- Permissions: Might need different permissions (though we're authenticated)
- Content Type: The content type might not support Subject updates via REST
- Check Plone REST API version on the server
- Inspect the actual request being sent (add request logging)
- Check if there's a schema endpoint that shows field definitions
- Try updating a different field (like title) to confirm PATCH works
- Check Plone REST API GitHub issues for similar problems