From 3fc63f40c10ed45a88193e98052b67f0ae474b76 Mon Sep 17 00:00:00 2001 From: "li.luo" Date: Tue, 24 Feb 2026 14:55:40 +0800 Subject: [PATCH 1/4] feat: add user management endpoints for creating and retrieving users --- apollo-openapi.yaml | 223 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 223 insertions(+) diff --git a/apollo-openapi.yaml b/apollo-openapi.yaml index 7fba16d..043ea7c 100644 --- a/apollo-openapi.yaml +++ b/apollo-openapi.yaml @@ -3601,6 +3601,173 @@ paths: allOf: - $ref: '#/components/schemas/SuccessEmptyResponse' headers: {} + /openapi/v1/users: + post: + summary: 创建用户 + operationId: createUser + deprecated: false + description: POST /openapi/v1/users + tags: + - User Management + security: + - ApiKeyAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenUserDTO' + example: + username: "new-user" + userDisplayName: "New User" + password: "P@ssw0rd123" + email: "new-user@example.com" + enabled: 1 + responses: + '200': + description: 成功创建用户,返回创建的用户信息 + content: + application/json: + schema: + $ref: '#/components/schemas/UserInfo' + example: + userId: "new-user" + name: "New User" + email: "new-user@example.com" + enabled: 1 + headers: {} + '400': + description: 请求参数错误(用户名/密码/邮箱为空,或密码强度不足) + content: + application/json: + schema: + $ref: '#/components/schemas/ExceptionResponse' + '401': + description: 未授权访问 + content: + application/json: + schema: + $ref: '#/components/schemas/ExceptionResponse' + '403': + description: 权限不足或当前用户服务不支持创建用户 + content: + application/json: + schema: + $ref: '#/components/schemas/ExceptionResponse' + get: + summary: 搜索用户列表 + operationId: searchUsers + deprecated: false + description: GET /openapi/v1/users + tags: + - User Management + security: + - ApiKeyAuth: [] + parameters: + - name: keyword + in: query + description: 搜索关键字(匹配用户名或显示名称),为空时返回所有用户 + required: false + schema: + type: string + default: "" + - name: includeInactiveUsers + in: query + description: 是否包含已停用的用户 + required: false + schema: + type: boolean + default: false + - name: offset + in: query + description: 分页偏移量,从0开始 + required: false + schema: + type: integer + default: 0 + minimum: 0 + - name: limit + in: query + description: 分页大小,取值范围 1~100 + required: false + schema: + type: integer + default: 10 + minimum: 1 + maximum: 100 + responses: + '200': + description: 成功获取用户列表 + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UserInfo' + example: + - userId: "apollo" + name: "Apollo Admin" + email: "apollo@example.com" + enabled: 1 + - userId: "dev-user" + name: "Dev User" + email: "dev@example.com" + enabled: 1 + headers: {} + '400': + description: 请求参数错误(offset或limit超出范围) + content: + application/json: + schema: + $ref: '#/components/schemas/ExceptionResponse' + '401': + description: 未授权访问 + content: + application/json: + schema: + $ref: '#/components/schemas/ExceptionResponse' + /openapi/v1/users/{userId}: + get: + summary: 根据用户ID获取用户信息 + operationId: getUserByUserId + deprecated: false + description: GET /openapi/v1/users/{userId} + tags: + - User Management + security: + - ApiKeyAuth: [] + parameters: + - name: userId + in: path + description: 用户ID(用户名) + required: true + schema: + type: string + responses: + '200': + description: 成功获取用户信息 + content: + application/json: + schema: + $ref: '#/components/schemas/UserInfo' + example: + userId: "apollo" + name: "Apollo Admin" + email: "apollo@example.com" + enabled: 1 + headers: {} + '400': + description: 用户不存在 + content: + application/json: + schema: + $ref: '#/components/schemas/ExceptionResponse' + '401': + description: 未授权访问 + content: + application/json: + schema: + $ref: '#/components/schemas/ExceptionResponse' /openapi/v1/envs: get: summary: 获取所有环境 @@ -4285,4 +4452,60 @@ components: - code - message + OpenUserDTO: + type: object + description: 用于创建用户的请求体 DTO + properties: + username: + type: string + description: 用户名(登录账号),创建时必填 + example: "new-user" + userDisplayName: + type: string + description: 用户显示名称,若不填则默认使用 username + example: "New User" + password: + type: string + description: 用户密码,创建时必填,需满足密码强度要求 + format: password + example: "P@ssw0rd123" + email: + type: string + description: 用户邮箱,创建时必填 + format: email + example: "new-user@example.com" + enabled: + type: integer + description: 用户状态:1-启用,0-停用,默认为1 + enum: [0, 1] + default: 1 + example: 1 + required: + - username + - password + - email + + UserInfo: + type: object + description: 用户信息 + properties: + userId: + type: string + description: 用户ID(即用户名) + example: "apollo" + name: + type: string + description: 用户显示名称 + example: "Apollo Admin" + email: + type: string + description: 用户邮箱 + format: email + example: "apollo@example.com" + enabled: + type: integer + description: 用户状态:1-启用,0-停用 + enum: [0, 1] + example: 1 + servers: [] From 72ff250ca0459f5d9ed4ff14767a12338fcf9fa0 Mon Sep 17 00:00:00 2001 From: No-99-Tongji <3167937401@qq.com> Date: Thu, 26 Feb 2026 22:16:37 +0800 Subject: [PATCH 2/4] feat: enhance user management API with improved response schemas and additional error handling --- apollo-openapi.yaml | 242 ++++++++++++++++++++++---------------------- 1 file changed, 120 insertions(+), 122 deletions(-) diff --git a/apollo-openapi.yaml b/apollo-openapi.yaml index 30a7f42..9d1a9bf 100644 --- a/apollo-openapi.yaml +++ b/apollo-openapi.yaml @@ -20,7 +20,7 @@ info: version: 1.0.0 security: - - ApiKeyAuth: [] + - ApiKeyAuth: [ ] tags: - name: App Management description: 应用管理相关接口,包括应用的创建、查询、更新、删除等操作 @@ -46,6 +46,8 @@ tags: description: 环境管理相关接口,包括环境查询等功能 - name: Permission Management description: 权限管理相关接口,包括权限查询等功能 + - name: User Management + description: Operations related to user accounts paths: /openapi/v1/apps: post: @@ -68,7 +70,7 @@ paths: application/json: schema: $ref: '#/components/schemas/OpenAppDTO' - headers: {} + headers: { } '400': description: '请求参数错误' content: @@ -126,7 +128,7 @@ paths: orgName: 'Microservices Team' ownerName: 'Dev Team' ownerEmail: 'dev@company.com' - headers: {} + headers: { } '401': description: '未授权访问' content: @@ -214,7 +216,7 @@ paths: clusters: - 'default' - 'backup' - headers: {} + headers: { } '404': description: '应用不存在' content: @@ -254,7 +256,7 @@ paths: orgName: 'Default Organization' ownerName: 'Apollo Admin' ownerEmail: 'admin@apollo.com' - headers: {} + headers: { } '404': description: '应用不存在' content: @@ -337,7 +339,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: {} + headers: { } /openapi/v1/apps/by-self: get: summary: 获取当前Consumer/User的应用列表(分页)(new added) @@ -391,7 +393,7 @@ paths: orgName: 'Business Team' ownerName: 'Business Team' ownerEmail: 'business@company.com' - headers: {} + headers: { } '401': description: '未授权访问' content: @@ -438,7 +440,7 @@ paths: parentClusterId: 0 comment: 'Default cluster' message: 'load env: DEV cluster error' - headers: {} + headers: { } /openapi/v1/apps/envs/{env}: post: summary: 在指定环境创建应用(new added) @@ -481,7 +483,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: {} + headers: { } /openapi/v1/apps/{appId}/miss-envs: get: summary: 查找缺失的环境(new added) @@ -572,7 +574,7 @@ paths: type: 0 value: '8080' comment: '服务器端口配置' - headers: {} + headers: { } '404': description: '配置项不存在' content: @@ -658,7 +660,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: {} + headers: { } delete: summary: 删除配置项 (original openapi) operationId: deleteItem @@ -791,7 +793,7 @@ paths: type: 0 value: 'INFO' comment: '日志级别配置' - headers: {} + headers: { } '404': description: '命名空间不存在' content: @@ -858,7 +860,7 @@ paths: type: 0 value: '8080' comment: '服务器端口配置' - headers: {} + headers: { } '400': description: '请求参数错误' content: @@ -926,7 +928,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: {} + headers: { } /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/encodedItems/{key}: get: summary: 通过查询参数获取配置项(支持编码的key) (original openapi) @@ -982,7 +984,7 @@ paths: type: 0 value: 'jdbc:mysql://localhost:3306/apollo?useUnicode=true&characterEncoding=utf8' comment: '数据库连接地址,包含特殊字符' - headers: {} + headers: { } '404': description: '配置项不存在' content: @@ -1068,7 +1070,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: {} + headers: { } delete: summary: 通过编码的key删除配置项 (original openapi) operationId: deleteItemByEncodedKey @@ -1116,7 +1118,7 @@ paths: responses: '200': description: '' - headers: {} + headers: { } /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/items: get: summary: 获取分支下的配置项 (new added) @@ -1184,7 +1186,7 @@ paths: type: 0 value: 'verbose' comment: '测试调试级别' - headers: {} + headers: { } '404': description: '分支不存在' content: @@ -1297,7 +1299,7 @@ paths: comment: '' lineNum: 0 extInfo: '' - headers: {} + headers: { } /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/synchronize: post: summary: 同步配置项到多个命名空间 (new added) @@ -1360,7 +1362,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: {} + headers: { } /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/validation: post: summary: 验证配置文本语法 (new added) @@ -1411,7 +1413,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: {} + headers: { } /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/revocation: post: summary: 撤销配置项更改 (new added) @@ -1468,7 +1470,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: {} + headers: { } /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}: get: summary: 获取指定集群信息 (original openapi) @@ -1510,7 +1512,7 @@ paths: dataChangeLastModifiedTime: '2024-01-18T09:15:00.000Z' name: production appId: sample-app - headers: {} + headers: { } '404': description: 集群不存在 content: @@ -1570,7 +1572,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: {} + headers: { } /openapi/v1/envs/{env}/apps/{appId}/clusters: post: summary: 创建集群 (original openapi) @@ -1611,7 +1613,7 @@ paths: dataChangeLastModifiedTime: '2024-01-15T10:30:00.000Z' name: test-cluster appId: sample-app - headers: {} + headers: { } '400': description: 请求参数错误 content: @@ -1691,7 +1693,7 @@ paths: 'spring.datasource.url': 'jdbc:mysql://localhost:3306/apollo' 'logging.level.root': 'INFO' comment: '首次发布,包含基础配置' - headers: {} + headers: { } '400': description: '发布参数错误' content: @@ -1760,7 +1762,7 @@ paths: 'logging.level.root': 'INFO' 'app.version': '1.2.0' comment: '最新生产发布版本,包含性能优化' - headers: {} + headers: { } '404': description: '未找到活跃发布' content: @@ -1842,7 +1844,7 @@ paths: 'logging.level.root': 'INFO' 'feature.new-feature': 'enabled' comment: '合并功能分支到主分支,包含新功能配置' - headers: {} + headers: { } '400': description: '合并参数错误' content: @@ -1926,7 +1928,7 @@ paths: configurations: '': '' comment: '' - headers: {} + headers: { } /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/gray-del-releases: post: summary: 创建灰度删除发布 (original openapi) @@ -1998,7 +2000,7 @@ paths: configurations: '': '' comment: '' - headers: {} + headers: { } /openapi/v1/envs/{env}/releases/{releaseId}/rollback: put: summary: 回滚发布 (original openapi) @@ -2071,7 +2073,7 @@ paths: configurations: '': '' comment: '' - headers: {} + headers: { } /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active: get: summary: 获取活跃发布(分页) (new added) @@ -2143,7 +2145,7 @@ paths: configurations: '': '' comment: '' - headers: {} + headers: { } /openapi/v1/envs/{env}/releases/comparison: get: tags: @@ -2218,7 +2220,7 @@ paths: application/json: schema: type: integer - headers: {} + headers: { } /openapi/v1/envs/{env}/instances/by-release: get: summary: 根据发布版本查询实例(支持分页) (new added) @@ -2289,7 +2291,7 @@ paths: releaseDeliveryTime: '' dataChangeLastModifiedTime: '' dataChangeCreatedTime: '' - headers: {} + headers: { } /openapi/v1/envs/{env}/instances/by-namespace: get: summary: 根据namespaceName查询实例(new added) @@ -2378,7 +2380,7 @@ paths: releaseDeliveryTime: '' dataChangeLastModifiedTime: '' dataChangeCreatedTime: '' - headers: {} + headers: { } /openapi/v1/envs/{env}/instances/by-namespace-and-releases-not-in: # avoidng confliction with other server endpoint get: summary: 查询不在指定发布版本中的实例 (new added) @@ -2449,7 +2451,7 @@ paths: releaseDeliveryTime: '' dataChangeLastModifiedTime: '' dataChangeCreatedTime: '' - headers: {} + headers: { } /openapi/v1/namespaces: post: summary: 创建Namespace (new added) @@ -2506,7 +2508,7 @@ paths: type: array items: $ref: '#/components/schemas/OpenNamespaceUsageDTO' - headers: {} + headers: { } /openapi/v1/apps/{appId}/appnamespaces: post: summary: 创建AppNamespace (original openapi) @@ -2552,7 +2554,7 @@ paths: isPublic: false appendNamespacePrefix: true comment: '数据库相关配置命名空间' - headers: {} + headers: { } '400': description: '请求参数错误' content: @@ -2599,7 +2601,7 @@ paths: isPublic: false appendNamespacePrefix: false comment: '' - headers: {} + headers: { } /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces: get: summary: 获取指定集群下的所有Namespace (original openapi) @@ -2671,7 +2673,7 @@ paths: type: 0 value: '' comment: '' - headers: {} + headers: { } /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}: get: summary: 获取指定的Namespace (original openapi) @@ -2747,7 +2749,7 @@ paths: type: 0 value: '' comment: '' - headers: {} + headers: { } /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/associated-public-namespace: get: summary: 查询关联Namespace对应的公共Namespace详情 (new added) @@ -2816,7 +2818,7 @@ paths: value: 'v1' - key: 'k2' value: 'v2' - headers: {} + headers: { } /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/lock: get: summary: 获取Namespace的锁状态 (original openapi) @@ -2861,7 +2863,7 @@ paths: namespaceName: '' isLocked: false lockedBy: '' - headers: {} + headers: { } /openapi/v1/appnamespaces: get: summary: 获取所有公共AppNamespace (new added) @@ -2890,7 +2892,7 @@ paths: isPublic: false appendNamespacePrefix: false comment: '' - headers: {} + headers: { } /openapi/v1/apps/{appId}/appnamespaces/{namespaceName}: get: summary: 获取指定的AppNamespace (new added) @@ -2937,7 +2939,7 @@ paths: isPublic: false appendNamespacePrefix: false comment: '' - headers: {} + headers: { } delete: summary: 删除AppNamespace (new added) operationId: deleteAppNamespace @@ -2967,7 +2969,7 @@ paths: responses: '200': description: 'AppNamespace删除成功' - headers: {} + headers: { } /openapi/v1/apps/{appId}/namespaces/releases/status: get: summary: 获取应用下所有Namespace的发布状态 (new added) @@ -2990,7 +2992,7 @@ paths: application/json: schema: $ref: '#/components/schemas/StringToStringBoolMap' - headers: {} + headers: { } /openapi/v1/envs/{env}/appnamespaces/{publicNamespaceName}/instances: get: summary: 获取公共AppNamespace的所有实例 (new added) @@ -3055,7 +3057,7 @@ paths: type: 0 value: '' comment: '' - headers: {} + headers: { } /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/usage: get: summary: 查询namespace使用情况(new added) @@ -3100,7 +3102,7 @@ paths: type: array items: $ref: '#/components/schemas/OpenNamespaceUsageDTO' - headers: {} + headers: { } /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/missing-namespaces: get: summary: 查找缺失的Namespace (new added) @@ -3141,7 +3143,7 @@ paths: type: string example: - '' - headers: {} + headers: { } post: summary: 创建缺失的Namespace (new added) operationId: createMissingNamespaces @@ -3248,7 +3250,7 @@ paths: orgName: 'Microservices Team' - orgId: 'infrastructure' orgName: 'Infrastructure Team' - headers: {} + headers: { } '401': description: '未授权访问' content: @@ -3330,7 +3332,7 @@ paths: type: 0 value: 'debug' comment: '测试模式配置' - headers: {} + headers: { } '404': description: '分支不存在' content: @@ -3402,7 +3404,7 @@ paths: type: 0 value: '' comment: '' - headers: {} + headers: { } /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}: delete: summary: 删除命名空间分支 (original openapi) @@ -3529,7 +3531,7 @@ paths: configurations: '': '' comment: '' - headers: {} + headers: { } /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/rules: get: summary: 获取分支灰度发布规则 (original openapi) @@ -3591,7 +3593,7 @@ paths: - '' clientLabelList: - '' - headers: {} + headers: { } put: summary: 更新分支灰度发布规则 (original openapi) operationId: updateBranchRules @@ -3645,13 +3647,7 @@ paths: responses: '200': description: '灰度规则更新成功' - content: - application/json: - schema: - type: object - allOf: - - $ref: '#/components/schemas/SuccessEmptyResponse' - headers: {} + headers: { } /openapi/v1/users: post: summary: 创建用户 @@ -3660,8 +3656,6 @@ paths: description: POST /openapi/v1/users tags: - User Management - security: - - ApiKeyAuth: [] requestBody: required: true content: @@ -3680,31 +3674,45 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserInfo' + $ref: '#/components/schemas/OpenUserInfoDTO' example: userId: "new-user" name: "New User" email: "new-user@example.com" enabled: 1 - headers: {} + headers: { } '400': description: 请求参数错误(用户名/密码/邮箱为空,或密码强度不足) content: application/json: schema: - $ref: '#/components/schemas/ExceptionResponse' + type: object + allOf: + - $ref: '#/components/schemas/ExceptionResponse' '401': description: 未授权访问 content: application/json: schema: - $ref: '#/components/schemas/ExceptionResponse' + type: object + allOf: + - $ref: '#/components/schemas/ExceptionResponse' '403': description: 权限不足或当前用户服务不支持创建用户 content: application/json: schema: - $ref: '#/components/schemas/ExceptionResponse' + type: object + allOf: + - $ref: '#/components/schemas/ExceptionResponse' + '409': + description: 用户名已存在(重复) + content: + application/json: + schema: + type: object + allOf: + - $ref: '#/components/schemas/ExceptionResponse' get: summary: 搜索用户列表 operationId: searchUsers @@ -3712,8 +3720,6 @@ paths: description: GET /openapi/v1/users tags: - User Management - security: - - ApiKeyAuth: [] parameters: - name: keyword in: query @@ -3754,7 +3760,7 @@ paths: schema: type: array items: - $ref: '#/components/schemas/UserInfo' + $ref: '#/components/schemas/OpenUserInfoDTO' example: - userId: "apollo" name: "Apollo Admin" @@ -3764,19 +3770,23 @@ paths: name: "Dev User" email: "dev@example.com" enabled: 1 - headers: {} + headers: { } '400': description: 请求参数错误(offset或limit超出范围) content: application/json: schema: - $ref: '#/components/schemas/ExceptionResponse' + type: object + allOf: + - $ref: '#/components/schemas/ExceptionResponse' '401': description: 未授权访问 content: application/json: schema: - $ref: '#/components/schemas/ExceptionResponse' + type: object + allOf: + - $ref: '#/components/schemas/ExceptionResponse' /openapi/v1/users/{userId}: get: summary: 根据用户ID获取用户信息 @@ -3785,8 +3795,6 @@ paths: description: GET /openapi/v1/users/{userId} tags: - User Management - security: - - ApiKeyAuth: [] parameters: - name: userId in: path @@ -3800,25 +3808,29 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserInfo' + $ref: '#/components/schemas/OpenUserInfoDTO' example: userId: "apollo" name: "Apollo Admin" email: "apollo@example.com" enabled: 1 - headers: {} - '400': + headers: { } + '404': description: 用户不存在 content: application/json: schema: - $ref: '#/components/schemas/ExceptionResponse' + type: object + allOf: + - $ref: '#/components/schemas/ExceptionResponse' '401': description: 未授权访问 content: application/json: schema: - $ref: '#/components/schemas/ExceptionResponse' + type: object + allOf: + - $ref: '#/components/schemas/ExceptionResponse' /openapi/v1/envs: get: summary: 获取所有环境 @@ -3841,7 +3853,7 @@ paths: - 'FAT' - 'UAT' - 'PRO' - headers: {} + headers: { } /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permission-init: post: summary: 初始化应用权限 (new added) @@ -4701,7 +4713,7 @@ paths: type: boolean example: members: - '': {} + '': { } /openapi/v1/system/roles/create-application/role-users: get: summary: 获取建应用用户 (new added) @@ -4710,7 +4722,7 @@ paths: description: '' tags: - Permission Management - parameters: [] + parameters: [ ] responses: '200': description: '' @@ -4789,7 +4801,7 @@ paths: description: '' tags: - Permission Management - parameters: [] + parameters: [ ] responses: '200': description: '' @@ -4801,7 +4813,7 @@ paths: type: boolean example: members: - '': {} + '': { } /openapi/v1/apps/{appId}/envs/{env}/accesskeys: post: summary: 创建AccessKey @@ -4849,7 +4861,7 @@ paths: appId: '' mode: 0 enabled: false - headers: {} + headers: { } get: summary: 查找AccessKey operationId: findAccessKeys @@ -4892,7 +4904,7 @@ paths: appId: '' mode: 0 enabled: false - headers: {} + headers: { } /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}: delete: summary: 删除AccessKey @@ -5608,19 +5620,19 @@ components: items: $ref: '#/components/schemas/OpenItemDTO' description: '待创建的配置项列表' - default: [] + default: [ ] updateItems: type: array items: $ref: '#/components/schemas/OpenItemDTO' description: '待更新的配置项列表' - default: [] + default: [ ] deleteItems: type: array items: $ref: '#/components/schemas/OpenItemDTO' description: '待删除的配置项列表' - default: [] + default: [ ] OpenItemDiffDTO: type: object properties: @@ -5739,19 +5751,26 @@ components: description: '' OpenUserInfoDTO: type: object + description: 用户信息 properties: userId: type: string - description: '' + description: 用户ID(即用户名) + example: "apollo" name: type: string - description: '' + description: 用户显示名称 + example: "Apollo Admin" email: type: string - description: '' + description: 用户邮箱 + format: email + example: "apollo@example.com" enabled: type: integer - description: '' + description: 用户状态:1-启用,0-停用 + enum: [ 0, 1 ] + example: 1 OpenEnvNamespaceRoleUserDTO: type: object properties: @@ -5909,7 +5928,7 @@ components: MultiResponseEntity: type: object - description: A response container holding multiple RichResponseEntity objects + description: "Reserved for endpoints that return multiple RichResponseEntity items. A response container holding multiple RichResponseEntity objects (intended future use)." properties: code: type: integer @@ -5926,7 +5945,7 @@ components: RichResponseEntity: type: object - description: A wrapper for a single response entity with code, message, and body + description: "Reserved for future use as a wrapper for a single response entity with code, message, and body." properties: code: type: integer @@ -5959,6 +5978,7 @@ components: type: string description: 用户密码,创建时必填,需满足密码强度要求 format: password + writeOnly: true example: "P@ssw0rd123" email: type: string @@ -5968,7 +5988,7 @@ components: enabled: type: integer description: 用户状态:1-启用,0-停用,默认为1 - enum: [0, 1] + enum: [ 0, 1 ] default: 1 example: 1 required: @@ -5976,27 +5996,5 @@ components: - password - email - UserInfo: - type: object - description: 用户信息 - properties: - userId: - type: string - description: 用户ID(即用户名) - example: "apollo" - name: - type: string - description: 用户显示名称 - example: "Apollo Admin" - email: - type: string - description: 用户邮箱 - format: email - example: "apollo@example.com" - enabled: - type: integer - description: 用户状态:1-启用,0-停用 - enum: [0, 1] - example: 1 -servers: [] +servers: [ ] From 1965f2bcc76ea41085e6382df46ff2d0acdacc5a Mon Sep 17 00:00:00 2001 From: No-99-Tongji <3167937401@qq.com> Date: Sun, 1 Mar 2026 23:34:40 +0800 Subject: [PATCH 3/4] fix: standardize empty object syntax in OpenAPI YAML file --- apollo-openapi.yaml | 146 ++++++++++++++++++++++---------------------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/apollo-openapi.yaml b/apollo-openapi.yaml index 9d1a9bf..495cbd6 100644 --- a/apollo-openapi.yaml +++ b/apollo-openapi.yaml @@ -20,7 +20,7 @@ info: version: 1.0.0 security: - - ApiKeyAuth: [ ] + - ApiKeyAuth: [] tags: - name: App Management description: 应用管理相关接口,包括应用的创建、查询、更新、删除等操作 @@ -70,7 +70,7 @@ paths: application/json: schema: $ref: '#/components/schemas/OpenAppDTO' - headers: { } + headers: {} '400': description: '请求参数错误' content: @@ -128,7 +128,7 @@ paths: orgName: 'Microservices Team' ownerName: 'Dev Team' ownerEmail: 'dev@company.com' - headers: { } + headers: {} '401': description: '未授权访问' content: @@ -173,7 +173,7 @@ paths: orgName: 'Microservices Team' ownerName: 'Dev Team' ownerEmail: 'dev@company.com' - headers: { } + headers: {} '401': description: '未授权访问' content: @@ -216,7 +216,7 @@ paths: clusters: - 'default' - 'backup' - headers: { } + headers: {} '404': description: '应用不存在' content: @@ -256,7 +256,7 @@ paths: orgName: 'Default Organization' ownerName: 'Apollo Admin' ownerEmail: 'admin@apollo.com' - headers: { } + headers: {} '404': description: '应用不存在' content: @@ -339,7 +339,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: { } + headers: {} /openapi/v1/apps/by-self: get: summary: 获取当前Consumer/User的应用列表(分页)(new added) @@ -393,7 +393,7 @@ paths: orgName: 'Business Team' ownerName: 'Business Team' ownerEmail: 'business@company.com' - headers: { } + headers: {} '401': description: '未授权访问' content: @@ -440,7 +440,7 @@ paths: parentClusterId: 0 comment: 'Default cluster' message: 'load env: DEV cluster error' - headers: { } + headers: {} /openapi/v1/apps/envs/{env}: post: summary: 在指定环境创建应用(new added) @@ -483,7 +483,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: { } + headers: {} /openapi/v1/apps/{appId}/miss-envs: get: summary: 查找缺失的环境(new added) @@ -574,7 +574,7 @@ paths: type: 0 value: '8080' comment: '服务器端口配置' - headers: { } + headers: {} '404': description: '配置项不存在' content: @@ -660,7 +660,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: { } + headers: {} delete: summary: 删除配置项 (original openapi) operationId: deleteItem @@ -793,7 +793,7 @@ paths: type: 0 value: 'INFO' comment: '日志级别配置' - headers: { } + headers: {} '404': description: '命名空间不存在' content: @@ -860,7 +860,7 @@ paths: type: 0 value: '8080' comment: '服务器端口配置' - headers: { } + headers: {} '400': description: '请求参数错误' content: @@ -928,7 +928,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: { } + headers: {} /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/encodedItems/{key}: get: summary: 通过查询参数获取配置项(支持编码的key) (original openapi) @@ -984,7 +984,7 @@ paths: type: 0 value: 'jdbc:mysql://localhost:3306/apollo?useUnicode=true&characterEncoding=utf8' comment: '数据库连接地址,包含特殊字符' - headers: { } + headers: {} '404': description: '配置项不存在' content: @@ -1070,7 +1070,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: { } + headers: {} delete: summary: 通过编码的key删除配置项 (original openapi) operationId: deleteItemByEncodedKey @@ -1118,7 +1118,7 @@ paths: responses: '200': description: '' - headers: { } + headers: {} /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/items: get: summary: 获取分支下的配置项 (new added) @@ -1186,7 +1186,7 @@ paths: type: 0 value: 'verbose' comment: '测试调试级别' - headers: { } + headers: {} '404': description: '分支不存在' content: @@ -1299,7 +1299,7 @@ paths: comment: '' lineNum: 0 extInfo: '' - headers: { } + headers: {} /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/synchronize: post: summary: 同步配置项到多个命名空间 (new added) @@ -1362,7 +1362,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: { } + headers: {} /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/validation: post: summary: 验证配置文本语法 (new added) @@ -1413,7 +1413,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: { } + headers: {} /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/revocation: post: summary: 撤销配置项更改 (new added) @@ -1470,7 +1470,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: { } + headers: {} /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}: get: summary: 获取指定集群信息 (original openapi) @@ -1512,7 +1512,7 @@ paths: dataChangeLastModifiedTime: '2024-01-18T09:15:00.000Z' name: production appId: sample-app - headers: { } + headers: {} '404': description: 集群不存在 content: @@ -1572,7 +1572,7 @@ paths: application/json: schema: $ref: '#/components/schemas/ExceptionResponse' - headers: { } + headers: {} /openapi/v1/envs/{env}/apps/{appId}/clusters: post: summary: 创建集群 (original openapi) @@ -1613,7 +1613,7 @@ paths: dataChangeLastModifiedTime: '2024-01-15T10:30:00.000Z' name: test-cluster appId: sample-app - headers: { } + headers: {} '400': description: 请求参数错误 content: @@ -1693,7 +1693,7 @@ paths: 'spring.datasource.url': 'jdbc:mysql://localhost:3306/apollo' 'logging.level.root': 'INFO' comment: '首次发布,包含基础配置' - headers: { } + headers: {} '400': description: '发布参数错误' content: @@ -1762,7 +1762,7 @@ paths: 'logging.level.root': 'INFO' 'app.version': '1.2.0' comment: '最新生产发布版本,包含性能优化' - headers: { } + headers: {} '404': description: '未找到活跃发布' content: @@ -1844,7 +1844,7 @@ paths: 'logging.level.root': 'INFO' 'feature.new-feature': 'enabled' comment: '合并功能分支到主分支,包含新功能配置' - headers: { } + headers: {} '400': description: '合并参数错误' content: @@ -1928,7 +1928,7 @@ paths: configurations: '': '' comment: '' - headers: { } + headers: {} /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/gray-del-releases: post: summary: 创建灰度删除发布 (original openapi) @@ -2000,7 +2000,7 @@ paths: configurations: '': '' comment: '' - headers: { } + headers: {} /openapi/v1/envs/{env}/releases/{releaseId}/rollback: put: summary: 回滚发布 (original openapi) @@ -2073,7 +2073,7 @@ paths: configurations: '': '' comment: '' - headers: { } + headers: {} /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active: get: summary: 获取活跃发布(分页) (new added) @@ -2145,7 +2145,7 @@ paths: configurations: '': '' comment: '' - headers: { } + headers: {} /openapi/v1/envs/{env}/releases/comparison: get: tags: @@ -2220,7 +2220,7 @@ paths: application/json: schema: type: integer - headers: { } + headers: {} /openapi/v1/envs/{env}/instances/by-release: get: summary: 根据发布版本查询实例(支持分页) (new added) @@ -2291,7 +2291,7 @@ paths: releaseDeliveryTime: '' dataChangeLastModifiedTime: '' dataChangeCreatedTime: '' - headers: { } + headers: {} /openapi/v1/envs/{env}/instances/by-namespace: get: summary: 根据namespaceName查询实例(new added) @@ -2380,7 +2380,7 @@ paths: releaseDeliveryTime: '' dataChangeLastModifiedTime: '' dataChangeCreatedTime: '' - headers: { } + headers: {} /openapi/v1/envs/{env}/instances/by-namespace-and-releases-not-in: # avoidng confliction with other server endpoint get: summary: 查询不在指定发布版本中的实例 (new added) @@ -2451,7 +2451,7 @@ paths: releaseDeliveryTime: '' dataChangeLastModifiedTime: '' dataChangeCreatedTime: '' - headers: { } + headers: {} /openapi/v1/namespaces: post: summary: 创建Namespace (new added) @@ -2508,7 +2508,7 @@ paths: type: array items: $ref: '#/components/schemas/OpenNamespaceUsageDTO' - headers: { } + headers: {} /openapi/v1/apps/{appId}/appnamespaces: post: summary: 创建AppNamespace (original openapi) @@ -2554,7 +2554,7 @@ paths: isPublic: false appendNamespacePrefix: true comment: '数据库相关配置命名空间' - headers: { } + headers: {} '400': description: '请求参数错误' content: @@ -2601,7 +2601,7 @@ paths: isPublic: false appendNamespacePrefix: false comment: '' - headers: { } + headers: {} /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces: get: summary: 获取指定集群下的所有Namespace (original openapi) @@ -2673,7 +2673,7 @@ paths: type: 0 value: '' comment: '' - headers: { } + headers: {} /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}: get: summary: 获取指定的Namespace (original openapi) @@ -2749,7 +2749,7 @@ paths: type: 0 value: '' comment: '' - headers: { } + headers: {} /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/associated-public-namespace: get: summary: 查询关联Namespace对应的公共Namespace详情 (new added) @@ -2818,7 +2818,7 @@ paths: value: 'v1' - key: 'k2' value: 'v2' - headers: { } + headers: {} /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/lock: get: summary: 获取Namespace的锁状态 (original openapi) @@ -2863,7 +2863,7 @@ paths: namespaceName: '' isLocked: false lockedBy: '' - headers: { } + headers: {} /openapi/v1/appnamespaces: get: summary: 获取所有公共AppNamespace (new added) @@ -2892,7 +2892,7 @@ paths: isPublic: false appendNamespacePrefix: false comment: '' - headers: { } + headers: {} /openapi/v1/apps/{appId}/appnamespaces/{namespaceName}: get: summary: 获取指定的AppNamespace (new added) @@ -2939,7 +2939,7 @@ paths: isPublic: false appendNamespacePrefix: false comment: '' - headers: { } + headers: {} delete: summary: 删除AppNamespace (new added) operationId: deleteAppNamespace @@ -2969,7 +2969,7 @@ paths: responses: '200': description: 'AppNamespace删除成功' - headers: { } + headers: {} /openapi/v1/apps/{appId}/namespaces/releases/status: get: summary: 获取应用下所有Namespace的发布状态 (new added) @@ -2992,7 +2992,7 @@ paths: application/json: schema: $ref: '#/components/schemas/StringToStringBoolMap' - headers: { } + headers: {} /openapi/v1/envs/{env}/appnamespaces/{publicNamespaceName}/instances: get: summary: 获取公共AppNamespace的所有实例 (new added) @@ -3057,7 +3057,7 @@ paths: type: 0 value: '' comment: '' - headers: { } + headers: {} /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/usage: get: summary: 查询namespace使用情况(new added) @@ -3102,7 +3102,7 @@ paths: type: array items: $ref: '#/components/schemas/OpenNamespaceUsageDTO' - headers: { } + headers: {} /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/missing-namespaces: get: summary: 查找缺失的Namespace (new added) @@ -3143,7 +3143,7 @@ paths: type: string example: - '' - headers: { } + headers: {} post: summary: 创建缺失的Namespace (new added) operationId: createMissingNamespaces @@ -3250,7 +3250,7 @@ paths: orgName: 'Microservices Team' - orgId: 'infrastructure' orgName: 'Infrastructure Team' - headers: { } + headers: {} '401': description: '未授权访问' content: @@ -3332,7 +3332,7 @@ paths: type: 0 value: 'debug' comment: '测试模式配置' - headers: { } + headers: {} '404': description: '分支不存在' content: @@ -3404,7 +3404,7 @@ paths: type: 0 value: '' comment: '' - headers: { } + headers: {} /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}: delete: summary: 删除命名空间分支 (original openapi) @@ -3531,7 +3531,7 @@ paths: configurations: '': '' comment: '' - headers: { } + headers: {} /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/rules: get: summary: 获取分支灰度发布规则 (original openapi) @@ -3593,7 +3593,7 @@ paths: - '' clientLabelList: - '' - headers: { } + headers: {} put: summary: 更新分支灰度发布规则 (original openapi) operationId: updateBranchRules @@ -3647,7 +3647,7 @@ paths: responses: '200': description: '灰度规则更新成功' - headers: { } + headers: {} /openapi/v1/users: post: summary: 创建用户 @@ -3680,7 +3680,7 @@ paths: name: "New User" email: "new-user@example.com" enabled: 1 - headers: { } + headers: {} '400': description: 请求参数错误(用户名/密码/邮箱为空,或密码强度不足) content: @@ -3770,7 +3770,7 @@ paths: name: "Dev User" email: "dev@example.com" enabled: 1 - headers: { } + headers: {} '400': description: 请求参数错误(offset或limit超出范围) content: @@ -3814,7 +3814,7 @@ paths: name: "Apollo Admin" email: "apollo@example.com" enabled: 1 - headers: { } + headers: {} '404': description: 用户不存在 content: @@ -3853,7 +3853,7 @@ paths: - 'FAT' - 'UAT' - 'PRO' - headers: { } + headers: {} /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permission-init: post: summary: 初始化应用权限 (new added) @@ -4713,7 +4713,7 @@ paths: type: boolean example: members: - '': { } + '': {} /openapi/v1/system/roles/create-application/role-users: get: summary: 获取建应用用户 (new added) @@ -4722,7 +4722,7 @@ paths: description: '' tags: - Permission Management - parameters: [ ] + parameters: [] responses: '200': description: '' @@ -4801,7 +4801,7 @@ paths: description: '' tags: - Permission Management - parameters: [ ] + parameters: [] responses: '200': description: '' @@ -4813,7 +4813,7 @@ paths: type: boolean example: members: - '': { } + '': {} /openapi/v1/apps/{appId}/envs/{env}/accesskeys: post: summary: 创建AccessKey @@ -4861,7 +4861,7 @@ paths: appId: '' mode: 0 enabled: false - headers: { } + headers: {} get: summary: 查找AccessKey operationId: findAccessKeys @@ -4904,7 +4904,7 @@ paths: appId: '' mode: 0 enabled: false - headers: { } + headers: {} /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}: delete: summary: 删除AccessKey @@ -5620,19 +5620,19 @@ components: items: $ref: '#/components/schemas/OpenItemDTO' description: '待创建的配置项列表' - default: [ ] + default: [] updateItems: type: array items: $ref: '#/components/schemas/OpenItemDTO' description: '待更新的配置项列表' - default: [ ] + default: [] deleteItems: type: array items: $ref: '#/components/schemas/OpenItemDTO' description: '待删除的配置项列表' - default: [ ] + default: [] OpenItemDiffDTO: type: object properties: @@ -5769,7 +5769,7 @@ components: enabled: type: integer description: 用户状态:1-启用,0-停用 - enum: [ 0, 1 ] + enum: [0, 1] example: 1 OpenEnvNamespaceRoleUserDTO: type: object @@ -5988,7 +5988,7 @@ components: enabled: type: integer description: 用户状态:1-启用,0-停用,默认为1 - enum: [ 0, 1 ] + enum: [0, 1] default: 1 example: 1 required: @@ -5997,4 +5997,4 @@ components: - email -servers: [ ] +servers: [] From 6704861040f5a8eeb2efb1223abbc079ddcfdec3 Mon Sep 17 00:00:00 2001 From: No-99-Tongji <3167937401@qq.com> Date: Wed, 4 Mar 2026 11:02:04 +0800 Subject: [PATCH 4/4] fix: standardize empty headers syntax in OpenAPI YAML file --- apollo-openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apollo-openapi.yaml b/apollo-openapi.yaml index 495cbd6..9fc4a33 100644 --- a/apollo-openapi.yaml +++ b/apollo-openapi.yaml @@ -173,7 +173,7 @@ paths: orgName: 'Microservices Team' ownerName: 'Dev Team' ownerEmail: 'dev@company.com' - headers: {} + headers: { } '401': description: '未授权访问' content: