{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentifizierung-de/json-schema/agentifizierung-de-json-rpc-response-schema.json",
  "title": "JsonRpcResponse",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentifizierung-de-openapi.json#/components/schemas/JsonRpcResponse",
  "type": "object",
  "properties": {
    "jsonrpc": {
      "type": "string",
      "enum": [
        "2.0"
      ]
    },
    "id": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "result": {
      "$ref": "#/$defs/AgentMessage"
    },
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer"
        },
        "message": {
          "type": "string"
        }
      }
    }
  },
  "required": [
    "jsonrpc"
  ],
  "$defs": {
    "AgentMessage": {
      "type": "object",
      "description": "Antwort des Endpunkts: ein Textteil für Menschen, ein Datenteil für Maschinen.",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "message"
          ]
        },
        "role": {
          "type": "string",
          "enum": [
            "agent"
          ]
        },
        "messageId": {
          "type": "string"
        },
        "contextId": {
          "type": "string"
        },
        "parts": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "$ref": "#/$defs/TextPart"
              },
              {
                "$ref": "#/$defs/DataPart"
              }
            ]
          }
        }
      },
      "required": [
        "kind",
        "role",
        "messageId",
        "parts"
      ]
    },
    "DataPart": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "data"
          ]
        },
        "data": {
          "type": "object"
        }
      },
      "required": [
        "kind",
        "data"
      ]
    },
    "TextPart": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "text"
          ]
        },
        "text": {
          "type": "string"
        }
      },
      "required": [
        "kind",
        "text"
      ]
    }
  }
}