{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/compabase/main/json-schema/compabase-person-connections-response-schema.json",
  "title": "PersonConnectionsResponse",
  "x-generated": "2026-10-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/compabase-openapi.yaml#/components/schemas/PersonConnectionsResponse",
  "type": "object",
  "required": [
    "person_id",
    "companies"
  ],
  "properties": {
    "person_id": {
      "type": "string",
      "format": "uuid"
    },
    "companies": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "entity_id",
          "relationships"
        ],
        "properties": {
          "entity_id": {
            "type": "string",
            "format": "uuid"
          },
          "registry_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "KRS number (10 digits), if available."
          },
          "company_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "relationships": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "kind",
                "role"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "description": "Relationship type (e.g. `management`, `ownership`)."
                },
                "role": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Role label (e.g. `PREZES ZARZĄDU`), if available."
                }
              }
            }
          }
        }
      }
    }
  }
}