{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/revyl/json-schema/revyl-build-branch-list-response-schema.json",
  "title": "BuildBranchListResponse",
  "description": "One page of an app's branches.\n\nThe app's default branch comes first, then the rest most recently active\nfirst: created, renamed, pinned, unpinned or given a build. Ties break by\nid. A search narrows the pages and the counts alike.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/revyl-app-branches-api-openapi.yml#/components/schemas/BuildBranchListResponse",
  "properties": {
    "branches": {
      "items": {
        "$ref": "#/$defs/BuildBranchListItem"
      },
      "maxItems": 100,
      "title": "Branches",
      "type": "array"
    },
    "has_next": {
      "description": "Whether a later page exists",
      "title": "Has Next",
      "type": "boolean"
    },
    "has_previous": {
      "description": "Whether an earlier page exists",
      "title": "Has Previous",
      "type": "boolean"
    },
    "page": {
      "default": 1,
      "description": "Current page number (1-indexed)",
      "maximum": 2147483647.0,
      "minimum": 1.0,
      "title": "Page",
      "type": "integer"
    },
    "page_size": {
      "default": 50,
      "description": "Branches per page",
      "maximum": 100.0,
      "minimum": 1.0,
      "title": "Page Size",
      "type": "integer"
    },
    "total": {
      "default": 0,
      "description": "Branches matching the request",
      "minimum": 0.0,
      "title": "Total",
      "type": "integer"
    },
    "total_pages": {
      "default": 1,
      "description": "Total number of pages",
      "minimum": 1.0,
      "title": "Total Pages",
      "type": "integer"
    }
  },
  "required": [
    "has_next",
    "has_previous"
  ],
  "type": "object",
  "$defs": {
    "BuildBranchLatestBuild": {
      "description": "The build a run following Latest would use on a branch.",
      "properties": {
        "id": {
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "uploaded_at": {
          "format": "date-time",
          "title": "Uploaded At",
          "type": "string"
        },
        "version": {
          "title": "Version",
          "type": "string"
        }
      },
      "required": [
        "id",
        "version",
        "uploaded_at"
      ],
      "title": "BuildBranchLatestBuild",
      "type": "object"
    },
    "BuildBranchListItem": {
      "description": "One branch in a page of an app's branches.",
      "properties": {
        "app_id": {
          "format": "uuid",
          "title": "App Id",
          "type": "string"
        },
        "created_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Created At"
        },
        "id": {
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "is_default": {
          "description": "Whether this is the app's default branch, which the list puts first",
          "title": "Is Default",
          "type": "boolean"
        },
        "latest_build": {
          "anyOf": [
            {
              "$ref": "#/$defs/BuildBranchLatestBuild"
            },
            {
              "type": "null"
            }
          ],
          "description": "The build a run following Latest would use on the branch; null when there is none"
        },
        "name": {
          "maxLength": 255,
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "pinned_build_available": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pinned Build Available"
        },
        "pinned_build_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pinned Build Id"
        },
        "pinned_build_version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pinned Build Version"
        }
      },
      "required": [
        "id",
        "app_id",
        "name",
        "is_default"
      ],
      "title": "BuildBranchListItem",
      "type": "object"
    }
  }
}