feat: add cloud-specific fields to OSS openapi.yaml as nullable#13623
feat: add cloud-specific fields to OSS openapi.yaml as nullable#13623MillerMedia wants to merge 5 commits intomasterfrom
Conversation
Add cross-runtime fields with x-runtime: [cloud] extension and [cloud-only]
description prefix per the convention established in BE-613. All new fields
are nullable and not in required arrays, so they are purely additive.
/api/features response:
- max_upload_size (integer, int64)
- free_tier_credits (integer, int32)
- posthog_api_host (string, uri)
- max_concurrent_jobs (integer, int32)
- workflow_templates_version (string)
- workflow_templates_source (string, enum)
PromptRequest schema:
- workflow_id (string, uuid)
- workflow_version_id (string, uuid)
POST /api/assets:
- id field (uuid) on multipart/form-data for idempotent creation
- application/json alternate content-type for URL-based uploads
POST /api/assets/from-hash:
- mime_type (string) to preserve type without re-inspection
PUT /api/assets/{id}:
- mime_type (string) for overriding auto-detection
GET /api/assets additional query parameters:
- job_ids (string) — filter by associated job UUIDs
- include_public (boolean) — include workspace-public assets
- asset_hash (string) — filter by exact content hash
Resolves: BE-613
Blocks: BE-364, BE-361, BE-363
Co-authored-by: Matt Miller <MillerMedia@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis pull request updates the OpenAPI spec to add cloud-only fields and parameters across several endpoints. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Review rate limit: 3/5 reviews remaining, refill in 20 minutes and 12 seconds. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@openapi.yaml`:
- Around line 1609-1617: The openapi schema for the URL-based upload currently
allows an empty object; update the object schema to make the url field required
by adding a required array containing "url" alongside the existing properties
(i.e., modify the object that defines properties.url in the URL-based upload
schema to include required: ["url"]) so clients and validators enforce the
presence of the url field.
- Around line 645-651: The OpenAPI doc for the max_upload_size property is
incorrect: remove the cloud-only annotation and the "Local ComfyUI returns null"
clause and update the description to reflect that /api/features (via
feature_flags.get_server_features and SERVER_FEATURE_FLAGS which uses
args.max_upload_size * 1024 * 1024) always returns a concrete numeric
max_upload_size; keep the type as integer/format int64/nullable true only if the
implementation still allows null, otherwise remove nullable and adjust
description accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a8f1b778-63f7-42d0-9488-592993e8f06b
📒 Files selected for processing (1)
openapi.yaml
- max_upload_size is set in both runtimes via SERVER_FEATURE_FLAGS; drop the cloud-only / nullable tagging. - Require `url` on the application/json POST /api/assets body so the contract is enforceable by validators and codegen.
9751b24 to
084422d
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@openapi.yaml`:
- Around line 654-677: The schema uses the removed OpenAPI 3.1 "nullable: true"
on fields like credits_available, posthog_api_host, max_concurrent_jobs,
workflow_templates_version, and workflow_templates_source; replace each
nullable: true usage by changing the field's type to a JSON Schema union (e.g.,
type: ["string","null"] or type: ["integer","null"] for int fields) so the
schema uses JSON Schema 2020-12 null unions instead of nullable, and apply the
same replacement to all other occurrences called out in the review (lines
referenced: 654–677, 1603–1642, 1683–1685, 1752–1754, 2113–2121) ensuring each
field’s base type is preserved when forming the ["<base-type>","null"] union.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6b837d3b-28aa-4596-ab1a-e532c3e3018f
📒 Files selected for processing (1)
openapi.yaml
Summary
Adds cross-runtime cloud fields to the OSS
openapi.yamlas nullable/optional with thex-runtime: [cloud]extension and[cloud-only]description prefix convention.All new fields are nullable and not in
requiredarrays, so they are purely additive and do not break existing consumers. Local ComfyUI ignores these fields entirely.Convention
Every cloud-specific field carries:
nullable: truex-runtime: [cloud]— machine-readable runtime declaration[cloud-only]description prefix — human-readable signalChanges
/api/featuresresponsemax_upload_sizeinteger (int64)free_tier_creditsinteger (int32)posthog_api_hoststring (uri)max_concurrent_jobsinteger (int32)workflow_templates_versionstringworkflow_templates_sourcestring (enum)PromptRequestschema (POST /api/prompt)workflow_idstring (uuid)workflow_version_idstring (uuid)POST /api/assetsidfield (uuid) tomultipart/form-datafor idempotent client-supplied creationapplication/jsonalternate content-type for URL-based uploads (cloud-only)POST /api/assets/from-hashmime_type(string) to preserve type without re-inspecting contentPUT /api/assets/{id}mime_type(string) for overriding auto-detectionGET /api/assetsquery parametersjob_idsstringinclude_publicbooleanasset_hashstringLinear Issue: BE-613