Class JsonProcessingExceptionMapper

java.lang.Object
io.jans.fido2.service.exception.JsonProcessingExceptionMapper
All Implemented Interfaces:
jakarta.ws.rs.ext.ExceptionMapper<com.fasterxml.jackson.core.JsonProcessingException>

@ApplicationScoped @Provider public class JsonProcessingExceptionMapper extends Object implements jakarta.ws.rs.ext.ExceptionMapper<com.fasterxml.jackson.core.JsonProcessingException>
Maps malformed request bodies (invalid JSON, bad base64url, unknown enum values, etc.) to the FIDO2 conformance failure envelope instead of a container-generated error page. The conformance suite sends many such negative vectors and expects a {status:"failed", errorMessage:...} response rather than a stack trace.
  • Constructor Details

    • JsonProcessingExceptionMapper

      public JsonProcessingExceptionMapper()
  • Method Details

    • toResponse

      public jakarta.ws.rs.core.Response toResponse(com.fasterxml.jackson.core.JsonProcessingException ex)
      Specified by:
      toResponse in interface jakarta.ws.rs.ext.ExceptionMapper<com.fasterxml.jackson.core.JsonProcessingException>