Interface ConstraintViolationConverter


public interface ConstraintViolationConverter
Converts a ConstraintViolationException into another exception. The converted exception is re-thrown.

By default, a ConstraintViolationException is converted into McpException with JSON-RPC error code -32602 (invalid params) and the message contains ConstraintViolation.getPropertyPath() and ConstraintViolation.getMessage() for each violation.

  • Method Summary

    Modifier and Type
    Method
    Description
    convert(jakarta.validation.ConstraintViolationException exception)
     
  • Method Details

    • convert

      Exception convert(jakarta.validation.ConstraintViolationException exception)
      Parameters:
      exception - (must not be null)
      Returns:
      the resulting exception