Skip to content

Add custom OpenAPI REST templates - #19383

Open
melohagan wants to merge 31 commits into
masterfrom
feature/custom-openapi-rest-template
Open

Add custom OpenAPI REST templates#19383
melohagan wants to merge 31 commits into
masterfrom
feature/custom-openapi-rest-template

Conversation

@melohagan

@melohagan melohagan commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds workspace custom OpenAPI REST templates that can be uploaded from the Connections API list, stored privately in MinIO, and reused to create REST connections and endpoint queries. Custom templates are identified in the UI, refresh immediately after upload, and can be deleted with confirmation.

Addresses

Screenshots

api_specs existing import custom_spec ws_folder uploaded_spec
deleting.mov

Deleting a custom rest template

Launchcontrol

Users can upload their own OpenAPI schema as a reusable REST API template, create connections from it, import its endpoints, and remove the template when it is no longer needed.

Comment thread packages/server/src/sdk/workspace/restTemplates.ts Outdated
@melohagan
melohagan marked this pull request as ready for review August 5, 2026 09:53

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review completed against the latest diff

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread packages/server/src/sdk/workspace/restTemplates.ts Outdated
Comment thread packages/server/src/sdk/workspace/restTemplates.ts
Comment thread packages/server/src/api/controllers/restTemplate.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 15 files (changes from recent commits).

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread packages/builder/src/stores/builder/index.ts
Comment thread packages/server/src/api/controllers/datasource.ts Outdated
Comment thread packages/server/src/api/controllers/datasource.ts Outdated
Comment thread packages/server/src/sdk/workspace/restTemplates.ts
Comment thread packages/server/src/api/controllers/query/index.ts
Comment thread packages/server/src/api/controllers/restTemplate.ts Outdated
Comment thread packages/server/src/sdk/workspace/restTemplates.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 5 files (changes from recent commits).

Tip: instead of fixing issues one by one fix them all with cubic
Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread packages/server/src/api/controllers/datasource.ts
Comment thread packages/server/src/api/controllers/query/index.ts
Comment thread packages/server/src/api/controllers/query/index.ts
Comment thread packages/server/src/api/controllers/query/index.ts
Comment thread packages/server/src/api/controllers/query/index.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread packages/server/src/api/controllers/query/index.ts

@deanhannigan deanhannigan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The scope of the custom templates seems conflicted. The minio location of the spec content is global, just like plugins. However, the scope of the feature in the builder is completely limited to a single workspace.

The unintended side-effect being that:

  • In order to use the same API across 2 workspaces I would have to upload it twice?
  • Upon deleting the workspace, the API spec is currently orphaned.

I believe the intention here was that specs would be imported at the platform level, just like plugins. Upload it once and maintain it globally.

@melohagan

Copy link
Copy Markdown
Collaborator Author

The scope of the custom templates seems conflicted. The minio location of the spec content is global, just like plugins . However, the the scope of the feature in the builder is completely limited to a single workspace.

The unintended side-effect being that:

  • In order to use the same API across 2 workspaces I would have to upload it twice?
  • Upon deleting the workspace, the API spec is currently orphaned.

I believe the intention here was that specs would be imported at the platform level, just like plugins. Upload it once and maintain it globally.

The problem is that per the design, a custom rest template is coupled to the connection, which is at the workspace level.

So in this case, to use the same API from a template across two workspaces it would need to be uploaded twice.

Good catch on the deletion of the workspace, it would need to clean up the orphaned template.


Do you think the design needs to be reconsidered to share custom rest templates between workspaces?

@deanhannigan

deanhannigan commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Do you think the design needs to be reconsidered to share custom rest templates between workspaces?

Yep, we should have a chat. It makes no sense to hold multiple copies of the exact same file.

@melohagan melohagan added the do not merge PR is not ready to be merged - generally the PR description should say why label Aug 10, 2026
@melohagan melohagan removed the do not merge PR is not ready to be merged - generally the PR description should say why label Aug 11, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 23 files (changes from recent commits).

Confidence score: 4/5

  • In packages/builder/src/settings/routes.ts, APIEditor still redirects missing/deleted connection flows from /connections/apis to API Specs, which can send users to the wrong section after delete/open actions and create confusing navigation regression — update both redirects to /connections/api-connections to keep users in Connections.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/builder/src/settings/routes.ts">

<violation number="1" location="packages/builder/src/settings/routes.ts:313">
P2: Deleting a connection or opening one that no longer exists now returns users to API Specs rather than Connections. Update APIEditor’s two `/connections/apis` redirects to `/connections/api-connections` to preserve the new section flow.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread packages/builder/src/settings/pages/connections/Connections.svelte
Comment thread packages/builder/src/settings/routes.ts
Comment thread packages/server/src/sdk/workspace/restTemplates.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 7 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread packages/shared-core/src/ids.ts Outdated
melohagan and others added 2 commits August 11, 2026 16:52
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
@melohagan
melohagan requested a review from deanhannigan August 11, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants