{
  "$ref": "#/definitions/network",
  "definitions": {
    "network": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/definitions/name"
        },
        "meta": {
          "$ref": "#/definitions/metadata"
        },
        "transactions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/transaction"
          }
        },
        "ussd_codes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ussd-code"
          }
        }
      },
      "required": [
        "name",
        "meta",
        "transactions",
        "ussd_codes"
      ]
    },
    "metadata": {
      "type": "object",
      "properties": {
        "spec": {
          "type": "string",
          "pattern": "^[0-9].[0-9]$"
        },
        "date_updated": {
          "$ref": "#/definitions/date"
        },
        "url": {
          "type": "string",
          "_format": "uri"
        }
      },
      "required": [
        "spec",
        "date_updated",
        "url"
      ]
    },
    "transaction": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/definitions/name"
        },
        "classes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/class"
          }
        },
        "amount_input": {
          "type": "boolean"
        }
      },
      "required": [
        "name",
        "classes"
      ]
    },
    "class": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/definitions/name"
        },
        "ranges": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/range"
          }
        },
        "amount": {
          "$ref": "#/definitions/cost"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "name"
      ]
    },
    "range": {
      "type": "object",
      "properties": {
        "low": {
          "$ref": "#/definitions/cost"
        },
        "high": {
          "$ref": "#/definitions/cost"
        },
        "amount": {
          "$ref": "#/definitions/cost"
        }
      },
      "required": [
        "low",
        "high",
        "amount"
      ]
    },
    "cost": {
      "type": [
        "number",
        "string"
      ],
      "minimum": -2,
      "pattern": "^[+-]Infinity$"
    },
    "ussd-code": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "description"
      ]
    },
    "name": {
      "type": "string"
    },
    "date": {
      "type": "string",
      "_format": "date"
    },
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "statusCode": {
          "type": "integer"
        }
      },
      "required": [
        "message",
        "name",
        "statusCode"
      ]
    }
  }
}