Package dev.relism.flash.ext.jackson
Class JacksonMiddleware
java.lang.Object
dev.relism.flash.ext.jackson.JacksonMiddleware
Outbound JSON marshalling middleware for class-based and lambda routes.
autoJson() marshals any non-body-native return value to JSON bytes,
writes Content-Type: application/json, and returns byte[] so
the Flash write path stays direct.
Pass-through return types:
nullResponsebyte[]StringCharSequence
-
Method Summary
-
Method Details
-
autoJson
Automatic JSON marshalling policy.For non-pass-through return values, serializes with Jackson directly to
byte[]and sets response content type to JSON.- Throws:
IllegalStateException- when serialization fails
-