{
  "openapi": "3.0.0",
  "info": {
    "title": "Jobily Public API",
    "version": "v1",
    "description": "Read-only, anonymous access to Greek job listings. No authentication required.\n\n**1. Search jobs** — `GET /api/Placement/SearchNewWithSuggestions`\nFree-text `SearchTerm` and/or slug filters (`Sector`, `Role`, `Location`, `Company`). Use `Slug1`/`Slug2`/`Slug3` to pass positionally classified slugs. Returns ranked results, facets (first page), and did-you-mean suggestions.\n\n**2. View a job** — `GET /api/Placement/{placementGuid}`\nFull posting: description, skills, benefits, company info.\n\n**3. Similar jobs** — `GET /api/Placement/{placementGuid}/similar`\nUp to `size` related listings (default 6).\n\n**4. Sector & role statistics** — browse market data.\n- `GET /api/SectorStatistics/sectors` — all sectors with slugs and job counts.\n- `GET /api/SectorStatistics/sectors/{slug}` — per-sector stats; optionally pass `locationSlug`.\n- `GET /api/SectorStatistics/roles/{slug}` — per-role stats; optionally pass `locationSlug`.\n- `GET /api/SectorStatistics/{slug1}/{slug2}/{slug3}` — combined slug lookup.\n- `GET /api/SectorStatistics` — top-level overview.",
    "contact": {
      "url": "https://jobily.gr"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://jobily.gr/Terms/PrivacyPolicy"
    }
  },
  "servers": [
    {
      "url": "https://api.jobily.gr",
      "description": "Jobily production API"
    }
  ],
  "paths": {
    "/api/Placement/SearchNewWithSuggestions": {
      "get": {
        "tags": ["Placement"],
        "operationId": "Placement_SearchNewWithSuggestions",
        "summary": "Search job listings",
        "description": "Search by free text, slugs, and/or filter criteria. Positional slugs (`Slug1`–`Slug3`) are auto-classified as sector, role, or location. Named filters take precedence. First page includes facets.",
        "parameters": [
          { "name": "Slug1", "in": "query", "schema": { "type": "string", "nullable": true } },
          { "name": "Slug2", "in": "query", "schema": { "type": "string", "nullable": true } },
          { "name": "Slug3", "in": "query", "schema": { "type": "string", "nullable": true } },
          { "name": "Sector", "in": "query", "description": "Sector slug filter", "schema": { "type": "string", "nullable": true } },
          { "name": "Location", "in": "query", "description": "Location slug filter", "schema": { "type": "string", "nullable": true } },
          { "name": "Role", "in": "query", "description": "Role slug filter", "schema": { "type": "string", "nullable": true } },
          { "name": "EmploymentType", "in": "query", "description": "Employment type filter", "schema": { "type": "string", "nullable": true } },
          { "name": "WorkplaceType", "in": "query", "description": "Workplace type filter", "schema": { "type": "string", "nullable": true } },
          { "name": "WorkTimeType", "in": "query", "description": "Work time filter", "schema": { "type": "string", "nullable": true } },
          { "name": "DatePosted", "in": "query", "description": "Recency filter", "schema": { "type": "string", "nullable": true } },
          { "name": "SearchTerm", "in": "query", "description": "Free-text search query", "schema": { "type": "string", "nullable": true } },
          { "name": "Company", "in": "query", "description": "Company slug filter", "schema": { "type": "string", "nullable": true } },
          { "name": "Page", "in": "query", "description": "Page number (1-based)", "schema": { "type": "integer", "format": "int32", "nullable": true } }
        ],
        "responses": {
          "200": {
            "description": "Search results with facets and suggestions",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/SearchResponse" }
              }
            }
          }
        }
      }
    },
    "/api/Placement/{placementGuid}": {
      "get": {
        "tags": ["Placement"],
        "operationId": "Placement_Get",
        "summary": "Get full job posting",
        "description": "Returns the full job detail. Check `outputEnum` for status: 0 = active, 1 = closed/expired, -1 = not found. When `redirectGuid` is set, the job has been replaced — fetch the new one.",
        "parameters": [
          { "name": "placementGuid", "in": "path", "required": true, "schema": { "type": "string" } },
          { "name": "lang", "in": "query", "description": "Response language (el or en)", "schema": { "type": "string", "nullable": true } }
        ],
        "responses": {
          "200": {
            "description": "Job detail or status indicator",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/JobDetailResponse" }
              }
            }
          }
        }
      }
    },
    "/api/Placement/{placementGuid}/similar": {
      "get": {
        "tags": ["Placement"],
        "operationId": "Placement_GetSimilar",
        "summary": "Get similar job listings",
        "parameters": [
          { "name": "placementGuid", "in": "path", "required": true, "schema": { "type": "string" } },
          { "name": "size", "in": "query", "description": "Max results (default 6)", "schema": { "type": "integer", "format": "int32", "default": 6 } },
          { "name": "excludeSameCompany", "in": "query", "description": "Exclude listings from the same company", "schema": { "type": "boolean", "default": false } }
        ],
        "responses": {
          "200": {
            "description": "Similar listings",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/SimilarJobsResponse" }
              }
            }
          }
        }
      }
    },
    "/api/SectorStatistics": {
      "get": {
        "tags": ["SectorStatistics"],
        "operationId": "SectorStatistics_GetAllSectors",
        "summary": "Top-level sector overview",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/StatisticsResponse" }
              }
            }
          }
        }
      }
    },
    "/api/SectorStatistics/sectors": {
      "get": {
        "tags": ["SectorStatistics"],
        "operationId": "SectorStatistics_GetSectors",
        "summary": "List all sectors",
        "responses": {
          "200": {
            "description": "All sectors with slugs and job counts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/SectorListItem" }
                }
              }
            }
          }
        }
      }
    },
    "/api/SectorStatistics/sectors/{slug}": {
      "get": {
        "tags": ["SectorStatistics"],
        "operationId": "SectorStatistics_GetSectorStatisticsBySlug",
        "summary": "Per-sector statistics",
        "description": "Top roles, skills, companies, experience distribution for a sector. Optionally filter by location.",
        "parameters": [
          { "name": "slug", "in": "path", "required": true, "schema": { "type": "string" } },
          { "name": "locationSlug", "in": "query", "schema": { "type": "string", "nullable": true } }
        ],
        "responses": {
          "200": {
            "description": "Sector statistics",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/SectorStatistics" }
              }
            }
          },
          "404": {
            "description": "Sector not found",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ProblemDetails" }
              }
            }
          }
        }
      }
    },
    "/api/SectorStatistics/roles/{slug}": {
      "get": {
        "tags": ["SectorStatistics"],
        "operationId": "SectorStatistics_GetRoleStatisticsBySlug",
        "summary": "Per-role statistics",
        "description": "Top locations, skills, seniority distribution for a role. Optionally filter by location.",
        "parameters": [
          { "name": "slug", "in": "path", "required": true, "schema": { "type": "string" } },
          { "name": "locationSlug", "in": "query", "schema": { "type": "string", "nullable": true } }
        ],
        "responses": {
          "200": {
            "description": "Role statistics",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/RoleStatistics" }
              }
            }
          },
          "404": {
            "description": "Role not found",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ProblemDetails" }
              }
            }
          }
        }
      }
    },
    "/api/SectorStatistics/{slug1}/{slug2}/{slug3}": {
      "get": {
        "tags": ["SectorStatistics"],
        "operationId": "SectorStatistics_GetStatisticsBySlug",
        "summary": "Combined slug lookup",
        "description": "Resolves up to 3 slugs (sector, role, location in any order) to the matching statistics page. The response `data` field is a discriminated union — check `data.index` or `data.isT0`–`isT3` to determine the type.",
        "parameters": [
          { "name": "slug1", "in": "path", "required": true, "schema": { "type": "string" } },
          { "name": "slug2", "in": "path", "required": true, "schema": { "type": "string", "nullable": true } },
          { "name": "slug3", "in": "path", "required": true, "schema": { "type": "string", "nullable": true } }
        ],
        "responses": {
          "200": {
            "description": "Resolved statistics page",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/StatisticsResponse" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EmploymentType": {
        "type": "integer",
        "description": "1 = Permanent (Aoristou), 2 = Fixed-term (Orismenou), 3 = Volunteer, 4 = Internship, 5 = Seasonal",
        "x-enumNames": ["Aoristou", "Orismenou", "Volunteer", "Internship", "Seasonal"],
        "enum": [1, 2, 3, 4, 5]
      },
      "WorkplaceType": {
        "type": "integer",
        "description": "1 = On-site, 2 = Hybrid, 3 = Remote",
        "x-enumNames": ["OnSite", "Hybrid", "Remote"],
        "enum": [1, 2, 3]
      },
      "WorkTimeType": {
        "type": "integer",
        "description": "1 = Full-time, 2 = Part-time",
        "x-enumNames": ["FullTime", "PartTime"],
        "enum": [1, 2]
      },
      "DateFilter": {
        "type": "integer",
        "description": "0 = None, 1 = Today, 2 = Last 3 days, 3 = Last week",
        "x-enumNames": ["None", "Today", "LastThreeDays", "LastWeek"],
        "enum": [0, 1, 2, 3]
      },
      "JobStatus": {
        "type": "integer",
        "description": "0 = Active (Ok/Success), 1 = Closed/expired (Gone), -1 = Not found",
        "x-enumNames": ["Ok", "Gone", "NotFound"],
        "enum": [0, 1, -1]
      },

      "SearchResponse": {
        "type": "object",
        "description": "Search results with facets (first page only) and suggestions.",
        "properties": {
          "results": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/JobSummary" }
          },
          "total": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "Total matching results"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "criteria": {
            "nullable": true,
            "description": "Resolved search criteria — what the backend recognized from the query",
            "oneOf": [{ "$ref": "#/components/schemas/SearchCriteria" }]
          },
          "facetedCriterionList": {
            "type": "array",
            "nullable": true,
            "description": "Sector facets with result counts",
            "items": {
              "type": "object",
              "properties": {
                "item": {
                  "nullable": true,
                  "oneOf": [{ "$ref": "#/components/schemas/SectorFacet" }]
                },
                "count": { "type": "integer", "format": "int32" }
              }
            }
          },
          "facetedEmploymentTypes": {
            "type": "array",
            "nullable": true,
            "description": "Employment type facets. item.id maps to EmploymentType enum values.",
            "items": {
              "type": "object",
              "properties": {
                "item": {
                  "nullable": true,
                  "oneOf": [{ "$ref": "#/components/schemas/EnumFacetItem" }]
                },
                "count": { "type": "integer", "format": "int32" }
              }
            }
          },
          "facetedWorkplaceTypes": {
            "type": "array",
            "nullable": true,
            "description": "Workplace type facets. item.id maps to WorkplaceType enum values.",
            "items": {
              "type": "object",
              "properties": {
                "item": {
                  "nullable": true,
                  "oneOf": [{ "$ref": "#/components/schemas/EnumFacetItem" }]
                },
                "count": { "type": "integer", "format": "int32" }
              }
            }
          },
          "facetedWorkTimeTypes": {
            "type": "array",
            "nullable": true,
            "description": "Work time type facets. item.id maps to WorkTimeType enum values.",
            "items": {
              "type": "object",
              "properties": {
                "item": {
                  "nullable": true,
                  "oneOf": [{ "$ref": "#/components/schemas/EnumFacetItem" }]
                },
                "count": { "type": "integer", "format": "int32" }
              }
            }
          },
          "facetedDateRange": {
            "type": "array",
            "nullable": true,
            "description": "Date range facets. item.id maps to DateFilter enum values.",
            "items": {
              "type": "object",
              "properties": {
                "item": {
                  "nullable": true,
                  "oneOf": [{ "$ref": "#/components/schemas/EnumFacetItem" }]
                },
                "count": { "type": "integer", "format": "int32" }
              }
            }
          },
          "facetedLocations": {
            "type": "array",
            "nullable": true,
            "description": "Location facets with result counts",
            "items": {
              "type": "object",
              "properties": {
                "item": {
                  "nullable": true,
                  "oneOf": [{ "$ref": "#/components/schemas/LocationFacet" }]
                },
                "count": { "type": "integer", "format": "int32" }
              }
            }
          },
          "suggestionType": {
            "type": "integer",
            "description": "0 = None, 1 = TypoCorrections, 2 = FilterRelaxation, 3 = Both, 4 = PopularRoles"
          },
          "typoSuggestions": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/DidYouMean" }
          },
          "filterRelaxations": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/FilterRelaxation" }
          },
          "popularRoleSuggestions": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/RoleSuggestion" }
          },
          "unmatchedSearchTerm": {
            "type": "string",
            "nullable": true,
            "description": "The portion of SearchTerm that could not be matched"
          },
          "locationExpansion": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/LocationExpansion" }]
          }
        }
      },

      "JobSummary": {
        "type": "object",
        "description": "A job listing in search results or similar listings. Call GET /api/Placement/{guid} for the full posting.",
        "properties": {
          "guid": { "type": "string", "format": "uuid" },
          "title": { "type": "string", "nullable": true },
          "company": { "type": "string", "nullable": true, "description": "Company display name" },
          "companySlug": { "type": "string", "nullable": true },
          "companyImageGuid": { "type": "string", "nullable": true, "description": "Company logo identifier" },
          "locationNameEl": { "type": "string", "nullable": true },
          "locationNameEn": { "type": "string", "nullable": true },
          "sectorNameEl": { "type": "string", "nullable": true },
          "sectorNameEn": { "type": "string", "nullable": true },
          "description": { "type": "string", "nullable": true, "description": "Plain-text description snippet" },
          "employmentType": { "type": "integer", "description": "See EmploymentType enum" },
          "workplaceType": { "type": "integer", "description": "See WorkplaceType enum" },
          "workTimeType": { "type": "integer", "description": "See WorkTimeType enum" },
          "createdDateTimeUtc": { "type": "string", "format": "date-time" },
          "expiresAtDateTimeUtc": { "type": "string", "format": "date-time" },
          "friendlyUrl": { "type": "string", "nullable": true, "description": "Canonical URL path for this listing" }
        }
      },

      "SearchCriteria": {
        "type": "object",
        "description": "What the backend recognized from the search query and slug filters.",
        "properties": {
          "location": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/MatchedLocation" }]
          },
          "sector": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/MatchedSector" }]
          },
          "role": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/MatchedRole" }]
          },
          "company": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/MatchedCompany" }]
          },
          "droppedSlugs": {
            "type": "array",
            "nullable": true,
            "description": "Slugs that were provided but could not be classified",
            "items": { "$ref": "#/components/schemas/ClassifiedSlug" }
          }
        }
      },
      "MatchedLocation": {
        "type": "object",
        "properties": {
          "slugEn": { "type": "string", "nullable": true },
          "slugEl": { "type": "string", "nullable": true },
          "nameEn": { "type": "string", "nullable": true },
          "nameEl": { "type": "string", "nullable": true }
        }
      },
      "MatchedSector": {
        "type": "object",
        "properties": {
          "slugEn": { "type": "string", "nullable": true },
          "slugEl": { "type": "string", "nullable": true },
          "nameEn": { "type": "string", "nullable": true },
          "nameEl": { "type": "string", "nullable": true }
        }
      },
      "MatchedRole": {
        "type": "object",
        "properties": {
          "slugEn": { "type": "string", "nullable": true },
          "slugEl": { "type": "string", "nullable": true },
          "nameEn": { "type": "string", "nullable": true },
          "nameEl": { "type": "string", "nullable": true },
          "sectorSlugEn": { "type": "string", "nullable": true, "description": "Parent sector slug" },
          "isMultiSector": { "type": "boolean", "description": "Role spans multiple sectors" }
        }
      },
      "MatchedCompany": {
        "type": "object",
        "properties": {
          "slug": { "type": "string", "nullable": true },
          "name": { "type": "string", "nullable": true }
        }
      },
      "ClassifiedSlug": {
        "type": "object",
        "properties": {
          "slug": { "type": "string", "nullable": true },
          "type": { "type": "string", "nullable": true }
        }
      },

      "SectorFacet": {
        "type": "object",
        "properties": {
          "nameEl": { "type": "string", "nullable": true },
          "nameEn": { "type": "string", "nullable": true },
          "slugEn": { "type": "string", "nullable": true },
          "slugEl": { "type": "string", "nullable": true }
        }
      },
      "LocationFacet": {
        "type": "object",
        "description": "Location in a facet list (trimmed to name/slug fields).",
        "properties": {
          "nameEl": { "type": "string", "nullable": true },
          "nameEn": { "type": "string", "nullable": true },
          "slugEn": { "type": "string", "nullable": true },
          "slugEl": { "type": "string", "nullable": true }
        }
      },
      "EnumFacetItem": {
        "type": "object",
        "description": "An enum value in a facet. The id maps to the enum type of the containing facet array (EmploymentType, WorkplaceType, WorkTimeType, or DateFilter).",
        "properties": {
          "id": { "type": "integer" },
          "name": { "type": "string", "nullable": true }
        }
      },

      "DidYouMean": {
        "type": "object",
        "properties": {
          "slug": { "type": "string", "nullable": true },
          "type": { "type": "string", "nullable": true },
          "nameEn": { "type": "string", "nullable": true },
          "nameEl": { "type": "string", "nullable": true },
          "score": { "type": "number", "format": "double" }
        }
      },
      "FilterRelaxation": {
        "type": "object",
        "properties": {
          "filterName": { "type": "string", "nullable": true },
          "suggestion": { "type": "string", "nullable": true },
          "currentValue": { "type": "string", "nullable": true },
          "currentValueDisplay": { "type": "string", "nullable": true },
          "currentValueDisplayEl": { "type": "string", "nullable": true }
        }
      },
      "RoleSuggestion": {
        "type": "object",
        "properties": {
          "slug": { "type": "string", "nullable": true },
          "nameEn": { "type": "string", "nullable": true },
          "nameEl": { "type": "string", "nullable": true },
          "placementCount": { "type": "integer", "format": "int32" }
        }
      },
      "LocationExpansion": {
        "type": "object",
        "description": "Nearby and parent location suggestions when a location filter is active.",
        "properties": {
          "nearby": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/NearbyLocation" }
          },
          "parent": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/ParentLocation" }]
          }
        }
      },
      "NearbyLocation": {
        "type": "object",
        "properties": {
          "slug": { "type": "string", "nullable": true },
          "nameEn": { "type": "string", "nullable": true },
          "nameEl": { "type": "string", "nullable": true },
          "count": { "type": "integer", "format": "int32" }
        }
      },
      "ParentLocation": {
        "type": "object",
        "properties": {
          "slug": { "type": "string", "nullable": true },
          "nameEn": { "type": "string", "nullable": true },
          "nameEl": { "type": "string", "nullable": true },
          "additionalCount": { "type": "integer", "format": "int32", "description": "Additional results available in the broader area" }
        }
      },

      "JobDetailResponse": {
        "type": "object",
        "description": "Job detail wrapper. Check outputEnum for status before reading vm.",
        "properties": {
          "outputEnum": {
            "$ref": "#/components/schemas/JobStatus"
          },
          "vm": {
            "nullable": true,
            "description": "Full job detail (null when Gone or NotFound)",
            "oneOf": [{ "$ref": "#/components/schemas/JobDetail" }]
          },
          "redirectGuid": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "When set, this job has been replaced — fetch the new one by this GUID"
          },
          "friendlyUrl": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "JobDetail": {
        "type": "object",
        "description": "Full job posting with structured sections.",
        "properties": {
          "guid": { "type": "string", "format": "uuid" },
          "title": { "type": "string", "nullable": true },
          "description": { "type": "string", "nullable": true, "description": "Full plain-text job description" },
          "company": { "type": "string", "nullable": true },
          "companySlug": { "type": "string", "nullable": true },
          "companyImageGuid": { "type": "string", "nullable": true },
          "locationNameEl": { "type": "string", "nullable": true },
          "locationNameEn": { "type": "string", "nullable": true },
          "sectorNameEl": { "type": "string", "nullable": true },
          "sectorNameEn": { "type": "string", "nullable": true },
          "sector": { "type": "string", "nullable": true, "description": "Sector slug" },
          "location": { "type": "string", "nullable": true, "description": "Location slug" },
          "employmentType": { "type": "integer", "description": "See EmploymentType enum" },
          "employmentTypeName": { "type": "string", "nullable": true, "description": "Localized employment type label" },
          "workplaceType": { "type": "integer", "description": "See WorkplaceType enum" },
          "workplaceTypeName": { "type": "string", "nullable": true, "description": "Localized workplace type label" },
          "workTimeType": { "type": "integer", "description": "See WorkTimeType enum" },
          "workTimeTypeName": { "type": "string", "nullable": true, "description": "Localized work time label" },
          "createdDateTimeUtc": { "type": "string", "format": "date-time" },
          "expiresAtDateTimeUtc": { "type": "string", "format": "date-time" },
          "friendlyUrl": { "type": "string", "nullable": true },
          "whatYouWillDo": {
            "type": "array",
            "nullable": true,
            "description": "AI-extracted responsibilities",
            "items": { "type": "string" }
          },
          "experience": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/ExperienceRequirement" }]
          },
          "mustHaveSkills": {
            "type": "array",
            "nullable": true,
            "description": "Required skills",
            "items": { "type": "string" }
          },
          "education": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/EducationRequirement" }]
          },
          "benefits": {
            "type": "array",
            "nullable": true,
            "items": { "type": "string" }
          }
        }
      },
      "ExperienceRequirement": {
        "type": "object",
        "properties": {
          "minYears": { "type": "integer", "format": "int32", "nullable": true },
          "preferredYears": { "type": "integer", "format": "int32", "nullable": true }
        }
      },
      "EducationRequirement": {
        "type": "object",
        "properties": {
          "fields": {
            "type": "array",
            "nullable": true,
            "items": { "type": "string" }
          },
          "preferred": { "type": "boolean" }
        }
      },

      "SimilarJobsResponse": {
        "type": "object",
        "description": "Similar job listings wrapper. Check outputEnum for status.",
        "properties": {
          "outputEnum": { "$ref": "#/components/schemas/JobStatus" },
          "vm": {
            "nullable": true,
            "type": "object",
            "properties": {
              "sourcePlacementGuid": { "type": "string", "nullable": true },
              "total": { "type": "integer", "format": "int32" },
              "items": {
                "type": "array",
                "nullable": true,
                "items": { "$ref": "#/components/schemas/JobSummary" }
              }
            }
          }
        }
      },

      "SectorListItem": {
        "type": "object",
        "properties": {
          "nameEn": { "type": "string", "nullable": true },
          "nameEl": { "type": "string", "nullable": true },
          "slug": { "type": "string", "nullable": true, "description": "English slug" },
          "slugEl": { "type": "string", "nullable": true, "description": "Greek slug" },
          "descriptionEn": { "type": "string", "nullable": true },
          "descriptionEl": { "type": "string", "nullable": true },
          "totalPlacements": { "type": "integer", "format": "int32" },
          "hasStatistics": { "type": "boolean", "description": "Whether the /sectors/{slug} endpoint returns data for this sector" }
        }
      },
      "SectorStatistics": {
        "type": "object",
        "description": "Per-sector market statistics.",
        "properties": {
          "sectorNameEn": { "type": "string", "nullable": true },
          "sectorNameEl": { "type": "string", "nullable": true },
          "sectorSlug": { "type": "string", "nullable": true },
          "sectorSlugEl": { "type": "string", "nullable": true },
          "sectorDescriptionEn": { "type": "string", "nullable": true },
          "sectorDescriptionEl": { "type": "string", "nullable": true },
          "totalPlacements": { "type": "integer", "format": "int32" },
          "version": { "type": "integer", "format": "int64", "description": "Data version for cache comparison" },
          "computedAt": { "type": "string", "format": "date-time", "description": "When statistics were last computed" },
          "locationNameEl": { "type": "string", "nullable": true, "description": "Set when filtered by location" },
          "locationNameEn": { "type": "string", "nullable": true },
          "locationSlug": { "type": "string", "nullable": true },
          "locationSlugEl": { "type": "string", "nullable": true },
          "topLocations": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/LocationStatisticsItem" }
          },
          "topRoles": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/StatisticsItem" }
          },
          "topSkills": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/StatisticsItem" }
          },
          "topNiceToHaveSkills": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/StatisticsItem" }
          },
          "topSoftSkills": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/StatisticsItem" }
          },
          "topEducationFields": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/StatisticsItem" }
          },
          "topCompanies": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/CompanyStatisticsItem" }
          },
          "seniorityDistribution": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/SeniorityBucket" }
          },
          "experienceYearsStats": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/ExperienceYearsStats" }]
          }
        }
      },
      "RoleStatistics": {
        "type": "object",
        "description": "Per-role market statistics.",
        "properties": {
          "sectorNameEn": { "type": "string", "nullable": true },
          "sectorNameEl": { "type": "string", "nullable": true },
          "sectorSlug": { "type": "string", "nullable": true },
          "sectorSlugEl": { "type": "string", "nullable": true },
          "roleNameEn": { "type": "string", "nullable": true },
          "roleNameEl": { "type": "string", "nullable": true },
          "roleSlug": { "type": "string", "nullable": true },
          "roleSlugEl": { "type": "string", "nullable": true },
          "roleDescriptionEn": { "type": "string", "nullable": true },
          "roleDescriptionEl": { "type": "string", "nullable": true },
          "totalPlacements": { "type": "integer", "format": "int32" },
          "version": { "type": "integer", "format": "int64" },
          "computedAt": { "type": "string", "format": "date-time" },
          "locationNameEl": { "type": "string", "nullable": true },
          "locationNameEn": { "type": "string", "nullable": true },
          "locationSlug": { "type": "string", "nullable": true },
          "locationSlugEl": { "type": "string", "nullable": true },
          "topLocations": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/LocationStatisticsItem" }
          },
          "topSkills": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/StatisticsItem" }
          },
          "topNiceToHaveSkills": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/StatisticsItem" }
          },
          "topSoftSkills": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/StatisticsItem" }
          },
          "topEducationFields": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/StatisticsItem" }
          },
          "topCompanies": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/CompanyStatisticsItem" }
          },
          "seniorityDistribution": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/SeniorityBucket" }
          },
          "experienceYearsStats": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/ExperienceYearsStats" }]
          }
        }
      },
      "RoleSectorListItem": {
        "type": "object",
        "description": "A role listing with its parent sector context.",
        "properties": {
          "roleNameEn": { "type": "string", "nullable": true },
          "roleNameEl": { "type": "string", "nullable": true },
          "roleSlugEn": { "type": "string", "nullable": true },
          "roleSlugEl": { "type": "string", "nullable": true },
          "sectorNameEn": { "type": "string", "nullable": true },
          "sectorNameEl": { "type": "string", "nullable": true },
          "sectorSlugEn": { "type": "string", "nullable": true },
          "sectorSlugEl": { "type": "string", "nullable": true },
          "totalPlacements": { "type": "integer", "format": "int32" },
          "hasStatistics": { "type": "boolean" }
        }
      },
      "StatisticsResponse": {
        "type": "object",
        "description": "Combined slug lookup response. The `data` field is a discriminated union — check `data.index` or `data.isT0`–`isT3`.",
        "properties": {
          "pageType": {
            "type": "string",
            "nullable": true,
            "description": "Resolved page type: sectors, sector, roles, role"
          },
          "context": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/ResolvedContext" }]
          },
          "data": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/StatisticsDataUnion" }]
          },
          "suggestions": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/StatsSuggestions" }]
          },
          "error": { "type": "string", "nullable": true }
        }
      },
      "StatisticsDataUnion": {
        "type": "object",
        "description": "Discriminated union. Check `index` (0–3) or `isT0`–`isT3` to determine the active type, then read the matching `asT*` field. 0 = sector list, 1 = sector stats, 2 = role-sector list, 3 = role stats.",
        "properties": {
          "index": { "type": "integer", "format": "int32", "description": "Active type index (0–3)" },
          "isT0": { "type": "boolean" },
          "isT1": { "type": "boolean" },
          "isT2": { "type": "boolean" },
          "isT3": { "type": "boolean" },
          "asT0": {
            "type": "array",
            "nullable": true,
            "description": "Sector list (when index = 0)",
            "items": { "$ref": "#/components/schemas/SectorListItem" }
          },
          "asT1": {
            "nullable": true,
            "description": "Sector statistics (when index = 1)",
            "oneOf": [{ "$ref": "#/components/schemas/SectorStatistics" }]
          },
          "asT2": {
            "type": "array",
            "nullable": true,
            "description": "Role-sector list (when index = 2)",
            "items": { "$ref": "#/components/schemas/RoleSectorListItem" }
          },
          "asT3": {
            "nullable": true,
            "description": "Role statistics (when index = 3)",
            "oneOf": [{ "$ref": "#/components/schemas/RoleStatistics" }]
          }
        }
      },
      "ResolvedContext": {
        "type": "object",
        "description": "Resolved entities from the slug lookup.",
        "properties": {
          "sector": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/EntityContext" }]
          },
          "role": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/EntityContext" }]
          },
          "location": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/LocationContext" }]
          }
        }
      },
      "EntityContext": {
        "type": "object",
        "properties": {
          "nameEn": { "type": "string", "nullable": true },
          "nameEl": { "type": "string", "nullable": true },
          "slugEn": { "type": "string", "nullable": true },
          "slugEl": { "type": "string", "nullable": true },
          "kind": { "type": "string", "nullable": true, "description": "Entity type: sector, role" }
        }
      },
      "LocationContext": {
        "type": "object",
        "properties": {
          "nameEn": { "type": "string", "nullable": true },
          "nameEl": { "type": "string", "nullable": true },
          "slugEn": { "type": "string", "nullable": true },
          "slugEl": { "type": "string", "nullable": true },
          "level": { "type": "integer", "format": "int32", "description": "Location hierarchy level" }
        }
      },
      "StatisticsItem": {
        "type": "object",
        "description": "An item in a top-N statistics list (roles, skills, education fields).",
        "properties": {
          "nameEn": { "type": "string", "nullable": true },
          "nameEl": { "type": "string", "nullable": true },
          "slug": { "type": "string", "nullable": true },
          "slugEl": { "type": "string", "nullable": true },
          "descriptionEn": { "type": "string", "nullable": true },
          "descriptionEl": { "type": "string", "nullable": true },
          "count": { "type": "integer", "format": "int32" }
        }
      },
      "CompanyStatisticsItem": {
        "type": "object",
        "properties": {
          "name": { "type": "string", "nullable": true },
          "slug": { "type": "string", "nullable": true },
          "logoUrl": { "type": "string", "nullable": true },
          "count": { "type": "integer", "format": "int32" }
        }
      },
      "LocationStatisticsItem": {
        "type": "object",
        "properties": {
          "nameEl": { "type": "string", "nullable": true },
          "nameEn": { "type": "string", "nullable": true },
          "slugEn": { "type": "string", "nullable": true },
          "slugEl": { "type": "string", "nullable": true },
          "count": { "type": "integer", "format": "int32" }
        }
      },
      "SeniorityBucket": {
        "type": "object",
        "properties": {
          "level": { "type": "string", "nullable": true },
          "count": { "type": "integer", "format": "int32" },
          "percentage": { "type": "number", "format": "decimal" }
        }
      },
      "ExperienceYearsStats": {
        "type": "object",
        "properties": {
          "minYears": { "type": "integer", "format": "int32", "nullable": true },
          "maxYears": { "type": "integer", "format": "int32", "nullable": true },
          "avgYears": { "type": "number", "format": "decimal", "nullable": true },
          "medianYears": { "type": "number", "format": "decimal", "nullable": true },
          "distribution": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/ExperienceYearsBucket" }
          }
        }
      },
      "ExperienceYearsBucket": {
        "type": "object",
        "properties": {
          "label": { "type": "string", "nullable": true },
          "minYears": { "type": "integer", "format": "int32" },
          "maxYears": { "type": "integer", "format": "int32", "nullable": true },
          "count": { "type": "integer", "format": "int32" },
          "percentage": { "type": "number", "format": "decimal" }
        }
      },
      "StatsSuggestions": {
        "type": "object",
        "description": "Suggestions for statistics pages (fallbacks, related sectors).",
        "properties": {
          "sectorsWithRole": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/SectorSuggestion" }
          },
          "popularSectors": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/SectorSuggestion" }
          },
          "locationFallback": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/LocationFallback" }]
          },
          "sectorFallback": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/SectorFallback" }]
          },
          "didYouMean": {
            "type": "array",
            "nullable": true,
            "items": { "$ref": "#/components/schemas/DidYouMean" }
          }
        }
      },
      "SectorSuggestion": {
        "type": "object",
        "properties": {
          "nameEn": { "type": "string", "nullable": true },
          "nameEl": { "type": "string", "nullable": true },
          "slugEn": { "type": "string", "nullable": true },
          "slugEl": { "type": "string", "nullable": true },
          "totalPlacements": { "type": "integer", "format": "int32" }
        }
      },
      "LocationFallback": {
        "type": "object",
        "description": "When the requested location has no data, suggests a broader area.",
        "properties": {
          "requested": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/LocationContext" }]
          },
          "actual": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/LocationContext" }]
          }
        }
      },
      "SectorFallback": {
        "type": "object",
        "description": "When the requested sector has no data, suggests an alternative.",
        "properties": {
          "requested": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/EntityContext" }]
          },
          "actual": {
            "nullable": true,
            "oneOf": [{ "$ref": "#/components/schemas/EntityContext" }]
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "additionalProperties": { "nullable": true },
        "properties": {
          "extensions": {
            "type": "object",
            "additionalProperties": {}
          }
        }
      }
    }
  }
}
