You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by "sergehuber (via GitHub)" <gi...@apache.org> on 2026/06/19 07:49:23 UTC

[PR] UNOMI-952: Return HTTP 400 for malformed Item JSON in REST requests [unomi]

sergehuber opened a new pull request, #777:
URL: https://github.com/apache/unomi/pull/777

   ## Summary
   - Harden `ItemDeserializer` to reject non-object or incomplete Item JSON (`itemType` / `itemId` required) with `JsonMappingException` instead of `ClassCastException` / NPE.
   - Map wrapped JSON deserialization failures in `RuntimeExceptionMapper` to HTTP **400** (`badRequest` JSON), completing the UNOMI-928 error-handling work for malformed REST payloads.
   - Add `ItemDeserializerTest` coverage including registered type mappings.
   
   ## JIRA
   - [UNOMI-952](https://issues.apache.org/jira/browse/UNOMI-952) (primary)
   - Related: UNOMI-933, UNOMI-945, UNOMI-928
   
   ## Test plan
   - [x] `mvn -pl persistence-spi test -Dtest=ItemDeserializerTest`
   - [x] `mvn -pl rest test -Dtest=RestExceptionMapperTest,LogSanitizerTest`
   - [ ] Manual: POST context/event payload with malformed `source`/`target` Item (e.g. `{}`, string) → HTTP 400 JSON `{"errorMessage":"badRequest"}`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@unomi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UNOMI-952: Return HTTP 400 for malformed Item JSON in REST requests [unomi]

Posted by "sergehuber (via GitHub)" <gi...@apache.org>.
sergehuber merged PR #777:
URL: https://github.com/apache/unomi/pull/777


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@unomi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org