{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lucca/json-schema/lucca-occupation-categories-read-schema.json",
  "title": "occupation-categories.read",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lucca-employee-occupation-categories-api-openapi.yml#/components/schemas/occupation-categories.read",
  "allOf": [
    {
      "$ref": "#/$defs/occupation-categories"
    },
    {
      "$ref": "#/$defs/occupation-category.embedded"
    }
  ],
  "$defs": {
    "business-establishment-reference": {
      "title": "business-establishment-reference",
      "description": "Reference to a [business-establishment](../organization/business-establishment) resource.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "type": "string",
          "const": "business-establishment"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "collection.links": {
      "type": "object",
      "properties": {
        "links": {
          "title": "Links",
          "description": "Links to related resources",
          "type": [
            "object",
            "null"
          ],
          "required": [
            "prev",
            "next"
          ],
          "properties": {
            "prev": {
              "description": "Link to the previous page, or `null` when there is none.\nIt may be set on the first page, and then leads to an empty page.",
              "allOf": [
                {
                  "$ref": "#/$defs/page-link"
                }
              ]
            },
            "next": {
              "description": "Link to the next page, or `null` when there is none: stop paging when `next` is `null`.\nIt may be set on the last page when that page is full, and then leads to an empty page whose `next` is `null`.",
              "allOf": [
                {
                  "$ref": "#/$defs/page-link"
                }
              ]
            }
          }
        }
      }
    },
    "occupation-categories": {
      "title": "occupation-categories",
      "description": "A collection of occupation-category resources.",
      "allOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "occupation-categories"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "totalCount": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int64",
              "minimum": 0,
              "description": "Total number of ocupation-category resources across all pages that satisfy query parameters."
            },
            "items": {
              "type": "array",
              "minItems": 0,
              "maxItems": 100,
              "items": {
                "$ref": "#/$defs/occupation-category"
              }
            }
          }
        },
        {
          "$ref": "#/$defs/collection.links"
        }
      ]
    },
    "occupation-category": {
      "title": "occupation-category",
      "description": "The occupation-category resource represents a categorization of employees belonging to a set of business-establishments.\n\nThese categories can be used as a way of distinguishing employees in reports, or may be used to specify reserved business rules (e.g. in the leaves management system).\n\nIn France, can be used to represent the \"Profession et Catégories Professionnelles\" (P.C.S.).",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "type": "string",
          "const": "occupation-category"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "description": "**Must be unique**. Invariant name of this occupation-category. Can be translated through `t9n.title.{langTag}`."
        },
        "businessEstablishments": {
          "description": "`null` value **MUST** be interpreted like \"ALL business-establishments, even those that will be created further down the line\".\n\nAs a result, array cannot be empty.",
          "type": [
            "null",
            "array"
          ],
          "minItems": 1,
          "items": {
            "$ref": "#/$defs/business-establishment-reference"
          }
        },
        "t9n": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "title": {
              "$ref": "#/$defs/t9n"
            }
          }
        },
        "links": {
          "type": "object",
          "additionalProperties": false
        }
      }
    },
    "occupation-category.embedded": {
      "type": "object",
      "properties": {
        "embedded": {
          "description": "No embedded resources on a occupation-category(ies) response. Expect an empty object if embedded are requested.",
          "type": [
            "object",
            "null"
          ]
        }
      }
    },
    "page-link": {
      "title": "page-link",
      "description": "Link to another page of a collection.",
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": false,
      "properties": {
        "href": {
          "type": "string",
          "format": "uri",
          "description": "URL of the page."
        }
      },
      "required": [
        "href"
      ]
    },
    "t9n": {
      "type": [
        "object",
        "null"
      ],
      "title": "Translations",
      "description": "Used for translation purposes. Object is structured as a dictionary whose keys refer to translated properties of the parent object, and whose values are a dictionary of supported languages.\n\nOn the parent object, the translated property value is considered the \"invariant\" translation. It is expected to show this value whenever the user's language has no translation in `t9n`.\n\nLanguages are identified through their RFC 4646 language tag.",
      "properties": {
        "de-DE": {
          "description": "German (Germany)",
          "type": [
            "string",
            "null"
          ]
        },
        "en-US": {
          "description": "English (United States of America)",
          "type": [
            "string",
            "null"
          ]
        },
        "en-GB": {
          "description": "English (Great Britain)",
          "type": [
            "string",
            "null"
          ]
        },
        "es-ES": {
          "description": "Spanish (Spain)",
          "type": [
            "string",
            "null"
          ]
        },
        "fr-FR": {
          "description": "French (France)",
          "type": [
            "string",
            "null"
          ]
        },
        "fr-CH": {
          "description": "French (Switzerland)",
          "type": [
            "string",
            "null"
          ]
        },
        "it-IT": {
          "description": "Italian (Italy)",
          "type": [
            "string",
            "null"
          ]
        },
        "nl-BE": {
          "description": "Dutch (Belgium)",
          "type": [
            "string",
            "null"
          ]
        },
        "nl-NL": {
          "description": "Dutch (Netherlands)",
          "type": [
            "string",
            "null"
          ]
        },
        "pt-PT": {
          "description": "Portuguese (Portugal)",
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}