{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pipeshub/json-schema/pipeshub-update-oauth-app-request-schema.json",
  "title": "UpdateOAuthAppRequest",
  "description": "Request to update an OAuth app (`updateAppSchema` in `oauth.validators.ts`).\n\nAll fields are optional — include only fields that should change. URL fields (`homepageUrl`, `privacyPolicyUrl`, `termsOfServiceUrl`) accept `null` to clear them (nullable in Zod).\n\n**Redirect rule (Zod refine):** If `allowedGrantTypes` includes `authorization_code` and `redirectUris` is present in the body, `redirectUris` must contain at least one URI.\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pipeshub-oauth-apps-api-openapi.yml#/components/schemas/UpdateOAuthAppRequest",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "App name",
      "minLength": 1,
      "maxLength": 100
    },
    "description": {
      "type": "string",
      "description": "App description",
      "maxLength": 500
    },
    "redirectUris": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      },
      "description": "Allowed redirect URIs (up to 10). Required when `authorization_code` grant type is enabled.\nPreserved in the database even if `authorization_code` is removed from grant types.\n",
      "maxItems": 10
    },
    "allowedGrantTypes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "authorization_code",
          "client_credentials",
          "refresh_token"
        ]
      }
    },
    "allowedScopes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 1
    },
    "homepageUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "privacyPolicyUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "termsOfServiceUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "accessTokenLifetime": {
      "type": "integer",
      "minimum": 300,
      "maximum": 86400
    },
    "refreshTokenLifetime": {
      "type": "integer",
      "minimum": 3600,
      "maximum": 31536000
    }
  }
}