Files

22 lines
1.6 KiB
Plaintext

jackson-databind 3.1.8, spring-boot 4.2.0
== client sends broken JSON
> POST /orders {"id": 1, "quantity": }
< 400 {"timestamp":"...","status":400,"error":"Bad Request","path":"/orders"}
log: WARN .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unexpected character ('}' (code 125)): expected a value]
== client sends a wrong type
> POST /orders {"id":1,"quantity":1,"lines":[{"sku":"A","qty":"two"}]}
< 400 {"timestamp":"...","status":400,"error":"Bad Request","path":"/orders"}
log: WARN .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize value of type `int` from String "two": not a valid `int` value]
== stored data is corrupt (server problem)
> GET /orders/stored
< 500 {"timestamp":"...","status":500,"error":"Internal Server Error","path":"/orders/stored"}
log: ERROR o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: tools.jackson.core.exc.UnexpectedEndOfInputException: Unexpected end-of-input within/between Object entries
== response cannot be serialised (server problem)
> GET /orders/unwritable
< 500 {"timestamp":"...","status":500,"error":"Internal Server Error","path":"/orders/unwritable"}
log: WARN .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: lazy collection not initialised]