{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/casedaleel-com/json-schema/casedaleel-com-professional-listing-schema.json",
  "title": "ProfessionalListing",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/casedaleel-com-openapi.yml#/components/schemas/ProfessionalListing",
  "type": "object",
  "properties": {
    "available": {
      "type": "boolean",
      "description": "false when the listing has no database behind it."
    },
    "total": {
      "type": "integer",
      "description": "Listed professionals matching the filters."
    },
    "count": {
      "type": "integer",
      "description": "Profiles in this response."
    },
    "professionals": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PublicProfessional"
      }
    },
    "filters": {
      "type": "object",
      "properties": {
        "area": {
          "type": [
            "string",
            "null"
          ]
        },
        "emirate": {
          "type": [
            "string",
            "null"
          ]
        },
        "language": {
          "type": [
            "string",
            "null"
          ]
        },
        "limit": {
          "type": "integer"
        }
      }
    },
    "labels": {
      "type": "object",
      "description": "English labels for the codes used above.",
      "properties": {
        "practiceAreas": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "languages": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "practitionerTypes": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "note": {
      "type": "string"
    }
  },
  "required": [
    "available",
    "total",
    "count",
    "professionals",
    "note"
  ],
  "$defs": {
    "PublicProfessional": {
      "type": "object",
      "description": "Built from a fixed whitelist of fields. No licence number, contact details or links.",
      "properties": {
        "display_name": {
          "type": "string"
        },
        "firm": {
          "type": [
            "string",
            "null"
          ]
        },
        "practitioner_type": {
          "type": "string",
          "enum": [
            "advocate",
            "legal_consultant",
            "other"
          ]
        },
        "practitioner_type_label": {
          "type": "string"
        },
        "emirates": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "Dubai",
              "Abu Dhabi",
              "Sharjah",
              "Ajman",
              "Umm Al Quwain",
              "Ras Al Khaimah",
              "Fujairah"
            ]
          }
        },
        "practice_areas": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "employment",
              "family",
              "rental",
              "real_estate",
              "commercial",
              "criminal",
              "debt_recovery",
              "immigration",
              "inheritance",
              "personal_injury",
              "banking",
              "corporate"
            ]
          }
        },
        "languages": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "ar",
              "en",
              "hi",
              "ur",
              "ml",
              "ta",
              "bn",
              "tl",
              "fa",
              "ru",
              "fr",
              "zh"
            ]
          }
        },
        "years_experience": {
          "type": [
            "integer",
            "null"
          ]
        },
        "bio": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 400
        },
        "licence_authority": {
          "type": [
            "string",
            "null"
          ],
          "description": "Authority that issued the licence."
        },
        "licence_checked_on": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "Date CaseDaleel checked the licence on the public register (Asia/Dubai)."
        }
      },
      "required": [
        "display_name",
        "practitioner_type",
        "emirates",
        "practice_areas",
        "languages"
      ]
    }
  }
}