{
  "$id": "https://spec.vitness.me/schemas/muscle/muscle-category/v1.1.0/muscle-category.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "FDS Muscle Category (v1.1.0)",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "id",
    "canonical",
    "metadata"
  ],
  "properties": {
    "schemaVersion": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
    },
    "id": {
      "type": "string"
    },
    "fxmg": {
      "$ref": "#/$defs/fxmg"
    },
    "canonical": {
      "$ref": "#/$defs/canonical"
    },
    "classification": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "media": {
      "$ref": "#/$defs/media"
    },
    "attributes": {
      "type": "object",
      "additionalProperties": true
    },
    "extensions": {
      "type": "object",
      "additionalProperties": true
    },
    "metadata": {
      "$ref": "#/$defs/metadata"
    }
  },
  "$defs": {
    "canonical": {
      "type": "object",
      "required": [
        "name",
        "slug"
      ],
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "slug": {
          "type": "string",
          "pattern": "^[a-z0-9-]{2,}$"
        },
        "description": {
          "type": "string",
          "minLength": 1
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "uniqueItems": true
        },
        "localized": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "lang",
              "name"
            ],
            "additionalProperties": false,
            "properties": {
              "lang": {
                "type": "string"
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "description": {
                "type": "string",
                "minLength": 1
              },
              "aliases": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "uniqueItems": true
              }
            }
          }
        }
      }
    },
    "fxmg": {
      "description": "The muscle category's structural key: the set of muscles the category holds. Optional; the pattern checks the header only. See https://spec.vitness.me/docs/core-concepts/structural-keys/muscle-category-key",
      "type": "string",
      "pattern": "^FXMG=1\\.0/"
    },
    "media": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "type",
          "uri"
        ],
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "image",
              "video",
              "doc",
              "3d"
            ]
          },
          "uri": {
            "type": "string",
            "format": "uri"
          },
          "caption": {
            "type": "string"
          },
          "license": {
            "type": "string"
          },
          "attribution": {
            "type": "string"
          }
        }
      }
    },
    "metadata": {
      "type": "object",
      "required": [
        "createdAt",
        "updatedAt",
        "status"
      ],
      "additionalProperties": false,
      "properties": {
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "source": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/status"
        },
        "deprecated": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "since": {
              "type": "string",
              "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
            },
            "replacedBy": {
              "type": "string"
            }
          }
        },
        "externalRefs": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "system",
              "id"
            ],
            "additionalProperties": false,
            "properties": {
              "system": {
                "type": "string"
              },
              "id": {
                "type": "string"
              }
            }
          }
        },
        "history": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "actor": {
                "type": "string"
              },
              "change": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "review",
        "active",
        "inactive",
        "deprecated"
      ],
      "default": "active"
    }
  }
}
