Skip to content

fix: Use open-api formatting not express#388

Merged
zacharyblasczyk merged 1 commit intomainfrom
fix-positional-paramaters
Mar 17, 2025
Merged

fix: Use open-api formatting not express#388
zacharyblasczyk merged 1 commit intomainfrom
fix-positional-paramaters

Conversation

@zacharyblasczyk
Copy link
Copy Markdown
Member

@zacharyblasczyk zacharyblasczyk commented Mar 17, 2025

Summary by CodeRabbit

  • Documentation
    • Standardized the API endpoint paths to use curly-brace notation for parameters across deployments, environments, resources, and systems. This change ensures that the API documentation adheres to OpenAPI 3.0 conventions.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 17, 2025

Walkthrough

This pull request standardizes the OpenAPI path parameter notation. It updates several endpoint definitions so that the workspace identifier changes from the colon-prefixed format (:workspaceId) to the curly-braced format ({workspaceId}), in accordance with the OpenAPI 3.0 specification. These modifications affect multiple endpoints in individual API files as well as the aggregated OpenAPI JSON specification.

Changes

File(s) Change Summary
apps/webservice/src/app/api/v1/workspaces/[workspaceId]/{deployments,environments,resources,systems}/openapi.ts Updated endpoint paths from "/v1/workspaces/:workspaceId/<resource>" to "/v1/workspaces/{workspaceId}/<resource>" for deployments, environments, resources, and systems.
openapi.v1.json Revised endpoints to use {workspaceId} instead of :workspaceId across deployments, environments, resources, and systems.

Possibly related PRs

Poem

In fields of code I happily roam,
Hopping through endpoints, far from home.
With {workspaceId} shining so bright,
Our API paths now leap into the light.
A bunny’s cheer for syntax so neat,
Each line a bound, each change a treat!
🐰💻 Celebrate the code, so crisp and sweet!

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2d75001 and 204a07d.

📒 Files selected for processing (5)
  • apps/webservice/src/app/api/v1/workspaces/[workspaceId]/deployments/openapi.ts (1 hunks)
  • apps/webservice/src/app/api/v1/workspaces/[workspaceId]/environments/openapi.ts (1 hunks)
  • apps/webservice/src/app/api/v1/workspaces/[workspaceId]/resources/openapi.ts (1 hunks)
  • apps/webservice/src/app/api/v1/workspaces/[workspaceId]/systems/openapi.ts (1 hunks)
  • openapi.v1.json (4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{ts,tsx}`: **Note on Error Handling:** Avoid strict en...

**/*.{ts,tsx}: Note on Error Handling:
Avoid strict enforcement of try/catch blocks. Code may use early returns, Promise chains (.then().catch()), or other patterns for error handling. These are acceptable as long as they maintain clarity and predictability.

  • apps/webservice/src/app/api/v1/workspaces/[workspaceId]/resources/openapi.ts
  • apps/webservice/src/app/api/v1/workspaces/[workspaceId]/environments/openapi.ts
  • apps/webservice/src/app/api/v1/workspaces/[workspaceId]/deployments/openapi.ts
  • apps/webservice/src/app/api/v1/workspaces/[workspaceId]/systems/openapi.ts
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Lint
  • GitHub Check: Typecheck
  • GitHub Check: build (linux/amd64)
🔇 Additional comments (8)
apps/webservice/src/app/api/v1/workspaces/[workspaceId]/systems/openapi.ts (1)

7-7: Great job updating to standard OpenAPI parameter notation!

You've correctly changed the Express-style path parameter notation (:workspaceId) to the OpenAPI 3.0 standard format using curly braces ({workspaceId}). This is the proper way to define path parameters in OpenAPI specifications and ensures better compatibility with OpenAPI tooling.

apps/webservice/src/app/api/v1/workspaces/[workspaceId]/environments/openapi.ts (1)

10-10: Correctly standardized the path parameter notation!

Excellent work replacing the Express-style parameter (:workspaceId) with the OpenAPI 3.0 standard format ({workspaceId}). This change maintains consistency with OpenAPI specifications and ensures proper documentation generation.

apps/webservice/src/app/api/v1/workspaces/[workspaceId]/deployments/openapi.ts (1)

10-10: Path parameter notation properly updated!

You've successfully converted the path parameter from Express format (:workspaceId) to OpenAPI 3.0 format ({workspaceId}). This change is consistent with the updates in other files and aligns with OpenAPI standards.

apps/webservice/src/app/api/v1/workspaces/[workspaceId]/resources/openapi.ts (1)

10-10: OpenAPI parameter format correctly implemented!

This completes the standardization of path parameter notation across all workspace-related endpoints. The change from :workspaceId to {workspaceId} ensures the API specification conforms to OpenAPI 3.0 standards, which will improve compatibility with OpenAPI tools and documentation generators.

openapi.v1.json (4)

2367-2403: Consistent OpenAPI Parameter Formatting for Deployments Endpoint

This endpoint now correctly uses curly braces ({workspaceId}) for the workspace identifier in the path (/v1/workspaces/{workspaceId}/deployments). This change fully complies with the OpenAPI 3.0 specification. Please ensure that any related documentation or client code references are updated to reflect this standardized format.


2404-2440: Standardized Path Formatting for Environments Endpoint

The endpoint /v1/workspaces/{workspaceId}/environments now properly uses the OpenAPI curly-brace style for its workspace ID parameter. This adjustment aligns the API definition with OpenAPI best practices and removes any old Express-style syntax.


2811-2847: Corrected Path Parameter Syntax for Resources Endpoint

The modifications for the endpoint /v1/workspaces/{workspaceId}/resources replace the Express-style colon syntax with the OpenAPI-standard curly braces. This ensures consistency in how path parameters are defined throughout the specification.


2848-2884: Aligned Path Parameter Notation for Systems Endpoint

The endpoint /v1/workspaces/{workspaceId}/systems now uses {workspaceId} instead of the colon-prefixed format. This update enhances clarity and standardization across your API endpoints, adhering to OpenAPI formatting requirements.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@zacharyblasczyk zacharyblasczyk merged commit f71e27f into main Mar 17, 2025
6 checks passed
@zacharyblasczyk zacharyblasczyk deleted the fix-positional-paramaters branch March 17, 2025 03:34
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.

2 participants