{
  "$ref": "#/definitions/Fixture",
  "definitions": {
    "Fixture": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "event_id": {
          "anyOf": [
            {
              "$ref": "#/definitions/Fixture/properties/id"
            },
            {
              "type": "null"
            }
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "scheduled",
            "in_progress",
            "completed",
            "cancelled"
          ]
        },
        "scheduled_at": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z$"
            },
            {
              "type": "null"
            }
          ]
        },
        "court": {
          "type": [
            "string",
            "null"
          ]
        },
        "stage": {
          "type": [
            "string",
            "null"
          ]
        },
        "is_provisional": {
          "type": "boolean"
        },
        "sides": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "side": {
                "type": "number",
                "enum": [
                  0,
                  1
                ]
              },
              "team": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "$ref": "#/definitions/Fixture/properties/id"
                      },
                      "name": {
                        "type": "string"
                      },
                      "abbreviation": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "abbreviation"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "matches_won": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "side",
              "team",
              "label",
              "matches_won"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "id",
        "event_id",
        "status",
        "scheduled_at",
        "court",
        "stage",
        "is_provisional",
        "sides"
      ],
      "additionalProperties": false
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}
