Class JsonRpcPayload

java.lang.Object
org.forgerock.openig.mcp.jsonrpc.JsonRpcPayload
Direct Known Subclasses:
JsonRpcRequest, JsonRpcResponse

public sealed class JsonRpcPayload extends Object permits JsonRpcRequest, JsonRpcResponse
Validates JSON-RPC 2.0 content.

Since this validator is primarily intended to be used in an MCP context it has several limitations:

  • it does not accept batch requests
  • it does not accept null valued IDs in requests.
  • it does not accept system extensions methods (those starting with "rpc.")
See Also:
  • Field Details

    • payload

      protected final com.fasterxml.jackson.databind.JsonNode payload
      The JSON-RPC payload.
    • lazyJsonValue

      protected JsonValue lazyJsonValue
      The lazy JSON value representation of the payload.
  • Constructor Details

    • JsonRpcPayload

      protected JsonRpcPayload(com.fasterxml.jackson.databind.JsonNode payload, McpSchemas.NamedJsonSchema validationSchema) throws JsonRpcValidationException
      Constructs a new JsonRpcMessage.
      Parameters:
      payload - the JSON-RPC payload
      validationSchema - the schema to validate against
      Throws:
      JsonRpcValidationException
    • JsonRpcPayload

      protected JsonRpcPayload(com.fasterxml.jackson.databind.JsonNode payload)
      Constructs a new JsonRpcMessage, with no validation. For internal use only.
      Parameters:
      payload - the JSON-RPC payload
  • Method Details