Fix OpenAPI validation by resolving duplicate content blocks

- Fixed all duplicate YAML content entries in both main and test files
- Reverted from OpenAPI 3.1 to 3.0.3 for GitHub Actions compatibility
- QueueItem now uses minItems/maxItems instead of prefixItems
- All endpoints now have proper response schema organization
This commit is contained in:
bymyself 2025-07-20 16:55:47 -07:00
parent 6a70191868
commit 7a691c980f
2 changed files with 118 additions and 127 deletions

View File

@ -1,4 +1,4 @@
openapi: 3.1.0 openapi: 3.0.3
info: info:
title: ComfyUI API title: ComfyUI API
description: 'API for ComfyUI - A powerful and modular UI for Stable Diffusion. description: 'API for ComfyUI - A powerful and modular UI for Stable Diffusion.
@ -1126,21 +1126,23 @@ components:
description: Additional metadata fields description: Additional metadata fields
QueueItem: QueueItem:
type: array type: array
description: Queue item containing execution details as a tuple [position, prompt_id, prompt, extra_data, outputs_to_execute] description: Queue item containing execution details as a 5-element tuple [position, prompt_id, prompt, extra_data, outputs_to_execute]
prefixItems: minItems: 5
- type: number maxItems: 5
description: Queue position number (lower numbers have higher priority) items:
- type: string oneOf:
format: uuid - type: number
description: Unique prompt identifier description: Queue position number (lower numbers have higher priority)
- type: object - type: string
description: Workflow graph with nodes and connections format: uuid
additionalProperties: true description: Unique prompt identifier
- type: object - type: object
description: Extra metadata (auth tokens, client info, etc.) description: Workflow graph with nodes and connections
additionalProperties: true additionalProperties: true
- type: array - type: object
description: Array of output node IDs description: Extra metadata (auth tokens, client info, etc.)
items: additionalProperties: true
type: string - type: array
items: false description: Array of output node IDs
items:
type: string

View File

@ -50,12 +50,6 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
content: content:
application/json: application/json:
schema: schema:
@ -111,12 +105,6 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
content: content:
application/json: application/json:
schema: schema:
@ -204,18 +192,18 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
content: content:
application/json: application/json:
schema: schema:
type: array type: array
items: items:
$ref: '#/components/schemas/HistoryItem' $ref: '#/components/schemas/HistoryItem'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
post: post:
tags: tags:
- workflow - workflow
@ -255,16 +243,16 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/HistoryItem'
'500': '500':
description: Internal server error description: Internal server error
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ErrorResponse' $ref: '#/components/schemas/ErrorResponse'
content:
application/json:
schema:
$ref: '#/components/schemas/HistoryItem'
/api/object_info: /api/object_info:
get: get:
tags: tags:
@ -275,18 +263,18 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
content: content:
application/json: application/json:
schema: schema:
type: object type: object
additionalProperties: additionalProperties:
$ref: '#/components/schemas/NodeInfo' $ref: '#/components/schemas/NodeInfo'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/object_info/{node_class}: /api/object_info/{node_class}:
get: get:
tags: tags:
@ -304,18 +292,18 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
content: content:
application/json: application/json:
schema: schema:
type: object type: object
additionalProperties: additionalProperties:
$ref: '#/components/schemas/NodeInfo' $ref: '#/components/schemas/NodeInfo'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/upload/image: /api/upload/image:
post: post:
tags: tags:
@ -357,18 +345,18 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/UploadResponse' $ref: '#/components/schemas/UploadResponse'
'400': '400':
description: Bad request description: Bad request
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/upload/mask: /api/upload/mask:
post: post:
tags: tags:
@ -396,19 +384,18 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/UploadResponse'
'400':
description: Bad request
'500': '500':
description: Internal server error description: Internal server error
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ErrorResponse' $ref: '#/components/schemas/ErrorResponse'
content:
application/json:
schema:
type: object
$ref: '#/components/schemas/UploadResponse'
'400':
description: Bad request
/api/view: /api/view:
get: get:
tags: tags:
@ -460,12 +447,6 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
content: content:
image/*: image/*:
schema: schema:
@ -475,6 +456,12 @@ paths:
description: Bad request description: Bad request
'404': '404':
description: File not found description: File not found
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/view_metadata/{folder_name}: /api/view_metadata/{folder_name}:
get: get:
tags: tags:
@ -520,18 +507,18 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
content: content:
application/json: application/json:
schema: schema:
type: array type: array
items: items:
type: string type: string
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/models/{folder}: /api/models/{folder}:
get: get:
tags: tags:
@ -549,12 +536,6 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
content: content:
application/json: application/json:
schema: schema:
@ -563,6 +544,12 @@ paths:
type: string type: string
'404': '404':
description: Folder not found description: Folder not found
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/embeddings: /api/embeddings:
get: get:
tags: tags:
@ -573,18 +560,18 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
content: content:
application/json: application/json:
schema: schema:
type: array type: array
items: items:
type: string type: string
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/extensions: /api/extensions:
get: get:
tags: tags:
@ -595,18 +582,18 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
content: content:
application/json: application/json:
schema: schema:
type: array type: array
items: items:
type: string type: string
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/system_stats: /api/system_stats:
get: get:
tags: tags:
@ -617,16 +604,16 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/SystemStats'
'500': '500':
description: Internal server error description: Internal server error
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ErrorResponse' $ref: '#/components/schemas/ErrorResponse'
content:
application/json:
schema:
$ref: '#/components/schemas/SystemStats'
/api/ws: /api/ws:
get: get:
tags: tags:
@ -659,16 +646,16 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/ServerFeatures'
'500': '500':
description: Internal server error description: Internal server error
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ErrorResponse' $ref: '#/components/schemas/ErrorResponse'
content:
application/json:
schema:
$ref: '#/components/schemas/ServerFeatures'
/internal/logs: /internal/logs:
get: get:
tags: tags:
@ -679,16 +666,16 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
content:
application/json:
schema:
type: string
'500': '500':
description: Internal server error description: Internal server error
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ErrorResponse' $ref: '#/components/schemas/ErrorResponse'
content:
application/json:
schema:
type: string
/internal/logs/raw: /internal/logs/raw:
get: get:
tags: tags:
@ -699,16 +686,16 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/RawLogsResponse'
'500': '500':
description: Internal server error description: Internal server error
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ErrorResponse' $ref: '#/components/schemas/ErrorResponse'
content:
application/json:
schema:
$ref: '#/components/schemas/RawLogsResponse'
/internal/logs/subscribe: /internal/logs/subscribe:
patch: patch:
tags: tags:
@ -741,18 +728,18 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
content: content:
application/json: application/json:
schema: schema:
type: object type: object
additionalProperties: additionalProperties:
type: string type: string
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/internal/files/{directory_type}: /internal/files/{directory_type}:
get: get:
tags: tags:
@ -774,12 +761,6 @@ paths:
responses: responses:
'200': '200':
description: Success description: Success
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
content: content:
application/json: application/json:
schema: schema:
@ -788,6 +769,12 @@ paths:
type: string type: string
'400': '400':
description: Invalid directory type description: Invalid directory type
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components: components:
schemas: schemas:
PromptRequest: PromptRequest:
@ -1139,11 +1126,13 @@ components:
description: Additional metadata fields description: Additional metadata fields
QueueItem: QueueItem:
type: array type: array
description: Queue item containing execution details description: Queue item containing execution details as a 5-element tuple [position, prompt_id, prompt, extra_data, outputs_to_execute]
minItems: 5
maxItems: 5
items: items:
oneOf: oneOf:
- type: integer - type: number
description: Queue position number description: Queue position number (lower numbers have higher priority)
- type: string - type: string
format: uuid format: uuid
description: Unique prompt identifier description: Unique prompt identifier