Skip to content

feat: add cloud-specific fields to OSS openapi.yaml as nullable#13623

Open
MillerMedia wants to merge 5 commits intomasterfrom
cursor/oss-spec-cloud-fields-1c03
Open

feat: add cloud-specific fields to OSS openapi.yaml as nullable#13623
MillerMedia wants to merge 5 commits intomasterfrom
cursor/oss-spec-cloud-fields-1c03

Conversation

@MillerMedia
Copy link
Copy Markdown
Contributor

Summary

Adds cross-runtime cloud fields to the OSS openapi.yaml as nullable/optional with the x-runtime: [cloud] extension and [cloud-only] description prefix convention.

All new fields are nullable and not in required arrays, so they are purely additive and do not break existing consumers. Local ComfyUI ignores these fields entirely.

Convention

Every cloud-specific field carries:

  • nullable: true
  • x-runtime: [cloud] — machine-readable runtime declaration
  • [cloud-only] description prefix — human-readable signal

Changes

/api/features response

Field Type Notes
max_upload_size integer (int64) Max upload size in bytes
free_tier_credits integer (int32) Credits available to free-tier users
posthog_api_host string (uri) PostHog analytics proxy URL
max_concurrent_jobs integer (int32) Max concurrent jobs for user
workflow_templates_version string Templates bundle version
workflow_templates_source string (enum) How templates version was resolved

PromptRequest schema (POST /api/prompt)

Field Type Notes
workflow_id string (uuid) Cloud workflow entity ID
workflow_version_id string (uuid) Cloud workflow version ID

POST /api/assets

  • Added id field (uuid) to multipart/form-data for idempotent client-supplied creation
  • Added application/json alternate content-type for URL-based uploads (cloud-only)

POST /api/assets/from-hash

  • Added mime_type (string) to preserve type without re-inspecting content

PUT /api/assets/{id}

  • Added mime_type (string) for overriding auto-detection

GET /api/assets query parameters

Parameter Type Notes
job_ids string Comma-separated UUIDs to filter by job
include_public boolean Include workspace-public assets
asset_hash string Filter by exact content hash

Linear Issue: BE-613

Open in Web Open in Cursor 

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>
@MillerMedia MillerMedia marked this pull request as ready for review April 29, 2026 20:41
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6e2ee6a5-3629-48ef-9a87-e9ec804a4b2c

📥 Commits

Reviewing files that changed from the base of the PR and between 9751b24 and 084422d.

📒 Files selected for processing (1)
  • openapi.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • openapi.yaml

📝 Walkthrough

Walkthrough

This pull request updates the OpenAPI spec to add cloud-only fields and parameters across several endpoints. GET /api/features returns typed cloud-only feature properties; GET /api/assets adds job_ids, include_public, and asset_hash query filters; POST /api/assets accepts multipart id for idempotent creation and a new application/json body for URL-based imports; asset creation-from-hash and asset updates accept nullable mime_type; PromptRequest gains nullable workflow_id and workflow_version_id.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change: adding cloud-specific nullable fields to the OpenAPI specification with proper conventions.
Description check ✅ Passed The description clearly explains the changes, conventions used, and provides detailed tables of all new fields being added across multiple endpoints.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0e25a69 and 9266db9.

📒 Files selected for processing (1)
  • openapi.yaml

Comment thread openapi.yaml Outdated
Comment thread 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.
@MillerMedia MillerMedia force-pushed the cursor/oss-spec-cloud-fields-1c03 branch from 9751b24 to 084422d Compare April 30, 2026 21:15
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9266db9 and 9751b24.

📒 Files selected for processing (1)
  • openapi.yaml

Comment thread openapi.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants