{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/freehire-me/json-schema/freehire-me-facets-envelope-schema.json",
  "title": "FacetsEnvelope",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/freehire-me-api-openapi.yml#/components/schemas/FacetsEnvelope",
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "total",
        "facets"
      ],
      "additionalProperties": true,
      "properties": {
        "total": {
          "type": "integer"
        },
        "facets": {
          "type": "object",
          "description": "Facet name to a map of value to matching-posting count.",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          }
        },
        "stats": {
          "type": "object",
          "description": "Numeric ranges (min/max) for the continuous facets —\n`salary_min`, `salary_max`, `experience_years_min`.\n",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            }
          }
        },
        "companies_total": {
          "type": "integer",
          "description": "Present only when `facets=` names `company_slug`: the exact number\nof distinct companies among the matching postings.\n"
        },
        "top_companies": {
          "type": "array",
          "maxItems": 50,
          "description": "Present only when `facets=` names `company_slug`: the companies\nwith the most matching postings, in descending count. Replaces a\n`company_slug` entry in `facets`.\n",
          "items": {
            "type": "object",
            "required": [
              "slug",
              "name",
              "count"
            ],
            "properties": {
              "slug": {
                "type": "string"
              },
              "name": {
                "type": "string",
                "description": "Display name; the slug when the company has none yet."
              },
              "count": {
                "type": "integer"
              }
            }
          }
        }
      }
    },
    "meta": {
      "type": "object",
      "additionalProperties": true,
      "description": "Present ONLY when the request carried a parameter no filter read,\nor a closed-facet value outside its vocabulary. A clean request\nanswers `{\"data\": ...}` with no meta block at all.\n",
      "properties": {
        "ignored_params": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/IgnoredParam"
          }
        },
        "ignored_values": {
          "$ref": "#/$defs/IgnoredValues"
        }
      }
    }
  },
  "$defs": {
    "IgnoredParam": {
      "type": "object",
      "required": [
        "param"
      ],
      "properties": {
        "param": {
          "type": "string",
          "description": "The query parameter that was received and not used."
        },
        "did_you_mean": {
          "type": "string",
          "description": "The vocabulary's name for it, when the only mistake was grammatical\nnumber — most facets are plural, so `country` resolves to\n`countries`. Absent when nothing is close enough; a guess would\nmislead more than silence.\n"
        }
      }
    },
    "IgnoredValues": {
      "type": "object",
      "description": "Present ONLY when a closed-vocabulary facet (or its `_exclude` form)\ncarried a value outside its vocabulary — keyed by the parameter as sent,\neach listing the unknown values. The value is still applied, so the\nfilter matches nothing on that axis; this says why the answer is empty.\n`apply_questions_max` is reported here too when its value is not a\nnon-negative integer — that bound is then NOT applied, so the answer is\nwider than asked.\n",
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    }
  }
}