Commit 112fcd5
authored
openapi: align response declarations with implementation (5 endpoints) (Comfy-Org#14058)
* openapi: align response declarations with implementation (5 endpoints)
- POST /api/assets/download: replace 200 with 202 + tracking-task body
(endpoint runs asynchronously and returns task_id/status/message).
- POST /api/assets/export: same 200 → 202 + tracking-task body.
- POST /api/assets/from-workflow: change 201 → 200 (handler responds 200,
not 201; no Location header emitted).
- POST /api/feedback: change 200 → 201 (creates a feedback record).
- /api/jobs and /api/jobs/{job_id}: change timestamp fields from
type: number to type: integer + format: int64. Values are Unix
milliseconds — number causes oapi-codegen to emit float64, losing
precision and producing the wrong Go type. Affected fields:
create_time, update_time, execution_start_time, execution_end_time.
Verification: each change reflects what the endpoint observably returns;
no handler changes required. Backwards-compatible for existing clients
(integer is a subset of number; status code shifts within 2xx).
* openapi: align asset download/export 202 status enum with runtime + sibling schemas
CodeRabbit caught a vocabulary mismatch: the two new 202 response schemas
declared `[pending, running, completed, failed]` while the rest of the same
spec uses `[created, running, completed, failed]` for the identical task
lifecycle (download/export progress WebSocket events, /api/tasks, TaskEntry,
TaskResponse — 4 sites total). Cloud's runtime emits `created` on initial
creation (AssetDownloadResponseStatusCreated; task.Status sourced from the
DB enum whose initial value is Created). `pending` would have introduced a
fifth, contradictory vocabulary for the same lifecycle and pushed the spec
further from the implementation it is meant to align with.
Followup tracked separately: extract a shared TaskStatus enum so all five
sites move in lockstep instead of needing per-site edits.1 parent 1579bbb commit 112fcd5
1 file changed
Lines changed: 51 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2342 | 2342 | | |
2343 | 2343 | | |
2344 | 2344 | | |
2345 | | - | |
2346 | | - | |
| 2345 | + | |
| 2346 | + | |
2347 | 2347 | | |
2348 | 2348 | | |
2349 | 2349 | | |
2350 | 2350 | | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
2351 | 2354 | | |
2352 | 2355 | | |
2353 | 2356 | | |
2354 | | - | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
2355 | 2366 | | |
2356 | 2367 | | |
2357 | 2368 | | |
| |||
2391 | 2402 | | |
2392 | 2403 | | |
2393 | 2404 | | |
2394 | | - | |
2395 | | - | |
| 2405 | + | |
| 2406 | + | |
2396 | 2407 | | |
2397 | 2408 | | |
2398 | 2409 | | |
2399 | 2410 | | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
2400 | 2414 | | |
2401 | 2415 | | |
2402 | 2416 | | |
2403 | | - | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
2404 | 2424 | | |
| 2425 | + | |
2405 | 2426 | | |
2406 | 2427 | | |
2407 | 2428 | | |
| |||
2476 | 2497 | | |
2477 | 2498 | | |
2478 | 2499 | | |
2479 | | - | |
2480 | | - | |
| 2500 | + | |
| 2501 | + | |
2481 | 2502 | | |
2482 | 2503 | | |
2483 | 2504 | | |
| |||
5056 | 5077 | | |
5057 | 5078 | | |
5058 | 5079 | | |
5059 | | - | |
| 5080 | + | |
5060 | 5081 | | |
5061 | 5082 | | |
5062 | 5083 | | |
| |||
6102 | 6123 | | |
6103 | 6124 | | |
6104 | 6125 | | |
6105 | | - | |
6106 | | - | |
| 6126 | + | |
| 6127 | + | |
| 6128 | + | |
6107 | 6129 | | |
6108 | | - | |
6109 | | - | |
| 6130 | + | |
| 6131 | + | |
| 6132 | + | |
6110 | 6133 | | |
6111 | | - | |
6112 | | - | |
| 6134 | + | |
| 6135 | + | |
| 6136 | + | |
6113 | 6137 | | |
6114 | 6138 | | |
6115 | 6139 | | |
| |||
6141 | 6165 | | |
6142 | 6166 | | |
6143 | 6167 | | |
6144 | | - | |
| 6168 | + | |
| 6169 | + | |
| 6170 | + | |
6145 | 6171 | | |
6146 | | - | |
| 6172 | + | |
| 6173 | + | |
| 6174 | + | |
6147 | 6175 | | |
6148 | | - | |
| 6176 | + | |
| 6177 | + | |
| 6178 | + | |
6149 | 6179 | | |
6150 | | - | |
| 6180 | + | |
| 6181 | + | |
| 6182 | + | |
6151 | 6183 | | |
6152 | 6184 | | |
6153 | 6185 | | |
| |||
0 commit comments