{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/yawplet/json-schema/yawplet-oauth-token-request-schema.json",
  "title": "OAuthTokenRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/yawplet-oauth-api-openapi.yml#/components/schemas/OAuthTokenRequest",
  "type": "object",
  "required": [
    "grant_type",
    "client_id"
  ],
  "properties": {
    "grant_type": {
      "type": "string",
      "enum": [
        "authorization_code",
        "refresh_token"
      ]
    },
    "client_id": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "description": "authorization_code: the code from the redirect"
    },
    "redirect_uri": {
      "type": "string",
      "format": "uri",
      "description": "authorization_code: the redirect_uri sent to the authorization endpoint"
    },
    "code_verifier": {
      "type": "string",
      "minLength": 43,
      "maxLength": 128,
      "description": "authorization_code: the PKCE verifier"
    },
    "refresh_token": {
      "type": "string",
      "description": "refresh_token: the current refresh token"
    },
    "scope": {
      "type": "string",
      "description": "refresh_token: optionally narrow the granted scopes"
    },
    "resource": {
      "type": "string",
      "format": "uri",
      "description": "RFC 8707: this site's https://<domain>/mcp"
    }
  }
}