{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://rsasaki0109.github.io/lidar_slam_ros2/schemas/v1-readiness-contract-v1.schema.json",
  "title": "lidarslam_ros2 v1 readiness contract v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "schema_uri",
    "product_version_source",
    "target_version",
    "minimum_release_candidate_version",
    "gates"
  ],
  "properties": {
    "schema_version": {
      "const": 1
    },
    "schema_uri": {
      "const": "https://rsasaki0109.github.io/lidar_slam_ros2/schemas/v1-readiness-contract-v1.schema.json"
    },
    "product_version_source": {
      "const": "VERSION"
    },
    "target_version": {
      "const": "1.0.0"
    },
    "minimum_release_candidate_version": {
      "const": "0.9.0"
    },
    "gates": {
      "type": "array",
      "minItems": 10,
      "maxItems": 10,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "state",
          "evidence",
          "blockers"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]+$"
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "state": {
            "enum": [
              "complete",
              "incomplete"
            ]
          },
          "evidence": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "blockers": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "state": {
                  "const": "complete"
                }
              }
            },
            "then": {
              "properties": {
                "blockers": {
                  "maxItems": 0
                }
              }
            },
            "else": {
              "properties": {
                "blockers": {
                  "minItems": 1
                }
              }
            }
          }
        ]
      }
    }
  }
}
