{
  "openapi": "3.0.0",
  "info": {
    "title": "n8n 公共 API",
    "version": "1.1.1"
  },
  "tags": [
    {
      "name": "RoleMappingRule",
      "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"
      }
    },
    "schemas": {
      "roleMappingRulePublicDto.generated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "expression": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "instance",
              "project"
            ]
          },
          "order": {
            "type": "integer"
          },
          "projectIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "expression",
          "role",
          "type",
          "order",
          "projectIds",
          "createdAt",
          "updatedAt"
        ]
      }
    },
    "responses": {
      "unauthorized": {
        "description": "未授权"
      },
      "forbidden": {
        "description": "禁止访问"
      },
      "notFound": {
        "description": "未找到指定资源。"
      }
    }
  },
  "paths": {
    "/role-mapping-rules/{roleMappingRuleId}": {
      "delete": {
        "operationId": "deleteRoleMappingRule",
        "tags": [
          "RoleMappingRule"
        ],
        "summary": "删除角色映射规则",
        "description": "删除角色映射规则。同类型的其余规则会补齐空位，使 `order` 值继续保持从 0 开始的连续序列。",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "角色映射规则的 ID。",
            "name": "roleMappingRuleId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "操作成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/roleMappingRulePublicDto.generated"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          }
        }
      }
    }
  }
}
