Class JacksonMiddleware

java.lang.Object
dev.relism.flash.ext.jackson.JacksonMiddleware

public final class JacksonMiddleware extends Object
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:

  • Method Details

    • autoJson

      public Middleware 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