{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/looot/json-schema/looot-patch-platform-key-schema.json",
  "title": "PatchPlatformKey",
  "description": "Same fields as SetPlatformKey minus secret -- every field optional, only the ones present are changed. Requires an existing platform key for this provider (nothing to reuse a vault ref from otherwise).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/looot-platform-keys-api-openapi.yml#/components/schemas/PatchPlatformKey",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "authMethod": {
      "enum": [
        "bearer",
        "header",
        "query",
        "basic",
        "multi"
      ],
      "description": "Selects which of headerName/paramName/valuePrefix/fields apply; omitted keeps the existing authConfig"
    },
    "headerName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "description": "Required when authMethod is \"header\""
    },
    "paramName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "description": "Required when authMethod is \"query\""
    },
    "valuePrefix": {
      "type": "string",
      "maxLength": 60
    },
    "fields": {
      "type": "array",
      "maxItems": 20,
      "description": "Required (at least one) when authMethod is \"multi\"",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "field",
          "placement",
          "name"
        ],
        "properties": {
          "field": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "placement": {
            "enum": [
              "header",
              "query"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "valuePrefix": {
            "type": "string",
            "maxLength": 60
          }
        }
      }
    },
    "platformFeeMicros": {
      "type": "integer",
      "minimum": 0
    },
    "approved": {
      "type": "boolean"
    }
  }
}