{
  "openapi": "3.0.0",
  "info": {
    "title": "n8n 公共 API",
    "version": "1.1.1"
  },
  "tags": [
    {
      "name": "Credential",
      "description": "凭据相关操作"
    }
  ],
  "servers": [
    {
      "url": "/api/v1",
      "description": "当前 n8n 实例（自托管版本的内置测试台）"
    },
    {
      "url": "{url}/api/v1",
      "description": "自托管 n8n 实例",
      "variables": {
        "url": {
          "default": "https://example.com"
        }
      }
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    },
    {
      "BearerAuth": []
    },
    {
      "CookieAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-N8N-API-KEY"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "CookieAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "n8n-auth"
      }
    },
    "responses": {
      "unauthorized": {
        "description": "未授权"
      },
      "notFound": {
        "description": "未找到指定资源。"
      }
    }
  },
  "paths": {
    "/credentials/schema/{credentialTypeName}": {
      "get": {
        "operationId": "getCredentialType",
        "tags": [
          "Credential"
        ],
        "summary": "显示凭据数据架构",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "要获取其架构的凭据类型名称",
            "name": "credentialTypeName",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "操作成功。",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "additionalProperties": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "object"
                      ]
                    },
                    "properties": {
                      "type": "object",
                      "additionalProperties": {},
                      "description": "凭据类型各字段的 JSON Schema 片段，以字段名为键。"
                    },
                    "required": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "请求必须包含的字段名称。具有默认值的字段不在此列表中。"
                    },
                    "allOf": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "additionalProperties",
                    "type",
                    "properties",
                    "required"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          }
        }
      }
    }
  }
}
