{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/audivo-dev/json-schema/audivo-dev-oauth-request-view-schema.json",
  "title": "OAuthRequestView",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/audivo-dev-connected-apps-api-openapi.yml#/components/schemas/OAuthRequestView",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "request_id",
    "client",
    "redirect",
    "scope",
    "scope_description",
    "expires_at"
  ],
  "properties": {
    "request_id": {
      "$ref": "#/$defs/OAuthRequestId"
    },
    "client": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "verified",
        "client_id",
        "kind"
      ],
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 100
        },
        "verified": {
          "type": "boolean",
          "description": "Whether the name is vouched for by where the code goes or by the app's metadata document, rather than claimed."
        },
        "client_id": {
          "type": "string",
          "maxLength": 2048
        },
        "kind": {
          "type": "string",
          "enum": [
            "metadata_document",
            "registered"
          ]
        }
      }
    },
    "redirect": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "target",
        "loopback"
      ],
      "properties": {
        "target": {
          "type": "string",
          "maxLength": 300,
          "description": "The host (or, for a native app, the scheme) the code is sent to."
        },
        "loopback": {
          "type": "boolean",
          "description": "A redirect to this computer: any program on it could be the listener, which the consent page warns about."
        }
      }
    },
    "scope": {
      "type": "string",
      "maxLength": 100
    },
    "scope_description": {
      "type": "string",
      "maxLength": 300
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "OAuthRequestId": {
      "type": "string",
      "pattern": "^oar_[a-f0-9]{24}$",
      "maxLength": 40,
      "description": "A pending OAuth authorization request, as the consent page's URL carries it."
    }
  }
}