{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/canonical/main/json-schema/canonical-artefact-matching-rule-request-schema.json",
  "title": "ArtefactMatchingRuleRequest",
  "description": "Request to create an artefact matching rule (extends base with team_ids)",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/canonical-artefact-matching-rules-api-openapi.yml#/components/schemas/ArtefactMatchingRuleRequest",
  "properties": {
    "name": {
      "type": "string",
      "title": "Name",
      "default": ""
    },
    "family": {
      "$ref": "#/$defs/FamilyName"
    },
    "stage": {
      "type": "string",
      "title": "Stage",
      "default": ""
    },
    "track": {
      "type": "string",
      "title": "Track",
      "default": ""
    },
    "branch": {
      "type": "string",
      "title": "Branch",
      "default": ""
    },
    "store": {
      "type": "string",
      "title": "Store",
      "default": ""
    },
    "series": {
      "type": "string",
      "title": "Series",
      "default": ""
    },
    "os": {
      "type": "string",
      "title": "Os",
      "default": ""
    },
    "release": {
      "type": "string",
      "title": "Release",
      "default": ""
    },
    "owner": {
      "type": "string",
      "title": "Owner",
      "default": ""
    },
    "grant_permissions": {
      "items": {
        "$ref": "#/$defs/Permission"
      },
      "type": "array",
      "title": "Grant Permissions"
    },
    "team_ids": {
      "items": {
        "type": "integer"
      },
      "type": "array",
      "title": "Team Ids"
    }
  },
  "type": "object",
  "required": [
    "family",
    "team_ids"
  ],
  "$defs": {
    "FamilyName": {
      "type": "string",
      "enum": [
        "snap",
        "deb",
        "charm",
        "image",
        "solution"
      ],
      "title": "FamilyName"
    },
    "Permission": {
      "type": "string",
      "enum": [
        "view_user",
        "change_user",
        "view_team",
        "change_team",
        "add_application",
        "change_application",
        "view_application",
        "view_permission",
        "view_issue",
        "change_issue",
        "change_issue_attachment",
        "change_issue_attachment_bulk",
        "change_attachment_rule",
        "change_auto_rerun",
        "view_test",
        "change_test",
        "view_rerun",
        "change_rerun",
        "change_rerun_bulk",
        "view_artefact",
        "change_artefact",
        "view_environment_review",
        "change_environment_review",
        "view_report",
        "view_test_case_reported_issue",
        "change_test_case_reported_issue",
        "view_environment_reported_issue",
        "change_environment_reported_issue",
        "view_notification",
        "change_notification",
        "view_sentry_debug"
      ],
      "title": "Permission"
    }
  }
}