class JsonMappingExceptionMapper implements ExceptionMapper<JsonMappingException> {

    @Override
    public Response toResponse(final JsonMappingException exception) {
        final var problemDetails = new ProblemDetails();
        problemDetails.setStatus(400);
        problemDetails.setTitle("The provided JSON payload could not be mapped");
        problemDetails.setDetail(createDetail(exception));

        return Response
                .status(Response.Status.BAD_REQUEST)
                .type(ProblemDetails.MEDIA_TYPE_JSON)
                .entity(problemDetails)
                .build();
    }

    private static String createDetail(final JsonMappingException exception) {<FILL_FUNCTION_BODY>}

}

        if (!(exception.getCause() instanceof StreamConstraintsException)) {
            return exception.getMessage();
        }

        final JsonMappingException.Reference reference = exception.getPath().get(0);
        if (Objects.equals(reference.getFrom(), BomSubmitRequest.class)
            && "bom".equals(reference.getFieldName())) {
            return """
                    The BOM is too large to be transmitted safely via Base64 encoded JSON value. \
                    Please use the "POST /api/v1/bom" endpoint with Content-Type "multipart/form-data" instead. \
                    Original cause: %s""".formatted(exception.getMessage());
        } else if (Objects.equals(reference.getFrom(), VexSubmitRequest.class)
                   && "vex".equals(reference.getFieldName())) {
            return """
                    The VEX is too large to be transmitted safely via Base64 encoded JSON value. \
                    Please use the "POST /api/v1/vex" endpoint with Content-Type "multipart/form-data" instead. \
                    Original cause: %s""".formatted(exception.getMessage());
        }

        return exception.getMessage();
    
<no_super_class>