openapi: promote workflow_templates_source enum to named schema

Cloud uses oapi-codegen to generate Go server code from this spec. With
nullable + inline enum, oapi-codegen 3.1 emits a reference to a generated
op-scoped type (e.g. `GetFeatures200JSONResponseWorkflowTemplatesSource`)
but doesn't emit the type definition itself — the generated code fails
to compile.

Promoting the enum to a top-level `WorkflowTemplatesSource` component
schema (referenced via allOf + $ref) makes oapi-codegen emit the type
declaration once at the schema name, and consumers reference it cleanly.

No behavioral change — same enum values, same nullability.
This commit is contained in:
Matt Miller 2026-05-27 00:39:43 -07:00
parent 6c543faf86
commit 69f9848c39

View File

@ -887,9 +887,9 @@ paths:
x-runtime: [cloud] x-runtime: [cloud]
description: "[cloud-only] Version identifier for the workflow templates bundle. Local ComfyUI returns null." description: "[cloud-only] Version identifier for the workflow templates bundle. Local ComfyUI returns null."
workflow_templates_source: workflow_templates_source:
type: string
nullable: true nullable: true
enum: [dynamic_config_override, workflow_templates_version_json] allOf:
- $ref: "#/components/schemas/WorkflowTemplatesSource"
x-runtime: [cloud] x-runtime: [cloud]
description: "[cloud-only] How the templates version was resolved. Local ComfyUI returns null." description: "[cloud-only] How the templates version was resolved. Local ComfyUI returns null."
@ -11918,3 +11918,11 @@ components:
x-runtime: x-runtime:
- cloud - cloud
description: "[cloud-only] Numeric rating (e.g. 1-5 stars) associated with the feedback." description: "[cloud-only] Numeric rating (e.g. 1-5 stars) associated with the feedback."
WorkflowTemplatesSource:
type: string
x-runtime: [cloud]
enum:
- dynamic_config_override
- workflow_templates_version_json
description: "[cloud-only] How the workflow templates version was resolved (config override vs. bundled JSON)."