fix(openapi): 补回图片异步响应契约

为 Images 生成与编辑接口重新声明 X-Async 参数和 202 TaskAcceptedResponse,保持 OpenAPI 与真实运行时行为一致。

已重新生成 Swagger,并通过 HTTP API 测试和桌面端生成客户端类型检查验证。
This commit is contained in:
2026-07-22 15:43:32 +08:00
parent 0b7c46cca9
commit 2812cadd4f
3 changed files with 47 additions and 0 deletions
+26
View File
@@ -5938,6 +5938,7 @@
"BearerAuth": []
}
],
"description": "默认同步返回 OpenAI-compatible Images 响应;设置 X-Async=true 时异步创建任务并返回 202。",
"consumes": [
"application/json"
],
@@ -5957,6 +5958,12 @@
"schema": {
"$ref": "#/definitions/httpapi.TaskRequest"
}
},
{
"type": "boolean",
"description": "true 时异步创建任务并返回 202",
"name": "X-Async",
"in": "header"
}
],
"responses": {
@@ -5966,6 +5973,12 @@
"$ref": "#/definitions/httpapi.CompatibleResponse"
}
},
"202": {
"description": "Accepted",
"schema": {
"$ref": "#/definitions/httpapi.TaskAcceptedResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
@@ -6000,6 +6013,7 @@
"BearerAuth": []
}
],
"description": "默认同步返回 OpenAI-compatible Images 响应;设置 X-Async=true 时异步创建任务并返回 202。",
"consumes": [
"application/json"
],
@@ -6019,6 +6033,12 @@
"schema": {
"$ref": "#/definitions/httpapi.TaskRequest"
}
},
{
"type": "boolean",
"description": "true 时异步创建任务并返回 202",
"name": "X-Async",
"in": "header"
}
],
"responses": {
@@ -6028,6 +6048,12 @@
"$ref": "#/definitions/httpapi.CompatibleResponse"
}
},
"202": {
"description": "Accepted",
"schema": {
"$ref": "#/definitions/httpapi.TaskAcceptedResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
+18
View File
@@ -7400,6 +7400,7 @@ paths:
post:
consumes:
- application/json
description: 默认同步返回 OpenAI-compatible Images 响应;设置 X-Async=true 时异步创建任务并返回 202。
parameters:
- description: OpenAI Images 请求
in: body
@@ -7407,6 +7408,10 @@ paths:
required: true
schema:
$ref: '#/definitions/httpapi.TaskRequest'
- description: true 时异步创建任务并返回 202
in: header
name: X-Async
type: boolean
produces:
- application/json
responses:
@@ -7414,6 +7419,10 @@ paths:
description: OK
schema:
$ref: '#/definitions/httpapi.CompatibleResponse'
"202":
description: Accepted
schema:
$ref: '#/definitions/httpapi.TaskAcceptedResponse'
"400":
description: Bad Request
schema:
@@ -7439,6 +7448,7 @@ paths:
post:
consumes:
- application/json
description: 默认同步返回 OpenAI-compatible Images 响应;设置 X-Async=true 时异步创建任务并返回 202。
parameters:
- description: OpenAI Images 请求
in: body
@@ -7446,6 +7456,10 @@ paths:
required: true
schema:
$ref: '#/definitions/httpapi.TaskRequest'
- description: true 时异步创建任务并返回 202
in: header
name: X-Async
type: boolean
produces:
- application/json
responses:
@@ -7453,6 +7467,10 @@ paths:
description: OK
schema:
$ref: '#/definitions/httpapi.CompatibleResponse'
"202":
description: Accepted
schema:
$ref: '#/definitions/httpapi.TaskAcceptedResponse'
"400":
description: Bad Request
schema: