{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/assignar/json-schema/assignar-skill-create-schema.json",
  "title": "SkillCreate",
  "description": "The same body as an update, except that `name` is required.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/assignar-skills-competencies-api-openapi.yml#/components/schemas/SkillCreate",
  "allOf": [
    {
      "$ref": "#/$defs/SkillUpdate"
    },
    {
      "type": "object",
      "required": [
        "name"
      ]
    }
  ],
  "$defs": {
    "SkillUpdate": {
      "type": "object",
      "description": "Every field is optional — send only what you want to change, and anything omitted is left as it is. A skill can be renamed without touching its sub-skill, and its sub-skill can be set or removed without renaming it.\n\nThe body itself must not be empty: `{}` is rejected with `[400] Missing payload.`",
      "properties": {
        "name": {
          "type": "string"
        },
        "subskill_id": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Sets or removes this skill's sub-skill: a skill that this skill also covers, so a worker holding this skill is treated as holding the sub-skill too. The relationship is transitive, and a skill has at most one sub-skill. Responses return it as `subskill`, an object.\n\n| Payload | Effect |\n| --- | --- |\n| key omitted | existing sub-skill untouched |\n| `null` | sub-skill removed |\n| a positive integer | sub-skill set, replacing any existing one |\n\nSetting one replaces the existing sub-skill rather than adding to it, since a skill has at most one.\n\nAccepts an integer or a digit-only string (`123` and `\"123\"` both work), but loose numeric forms are rejected rather than coerced — `\"1e1\"`, `\"0x3\"`, `\" 123 \"`, `\"+5\"` and `\"123.0\"` are all `400`. `-1` is not a removal sentinel on this API and is rejected; use `null`."
        }
      }
    }
  }
}