Skip to content

feat: enhance workspace and environment API schemas with comprehensive documentation#546

Open
1012Charan wants to merge 2 commits intomeshery:masterfrom
1012Charan:chore/add-environment-workspace-endpoints
Open

feat: enhance workspace and environment API schemas with comprehensive documentation#546
1012Charan wants to merge 2 commits intomeshery:masterfrom
1012Charan:chore/add-environment-workspace-endpoints

Conversation

@1012Charan
Copy link
Copy Markdown
Contributor

@1012Charan 1012Charan commented Jan 11, 2026

Description

This PR enhances the OpenAPI schemas for workspace and environment constructs in schemas/constructs/v1beta1. It addresses gaps in API documentation by adding comprehensive descriptions, standardizing error responses, and improving schema definitions.

Changes

Workspace Construct (v1beta1/workspace)

  • Enhanced Documentation: Added detailed descriptions for all endpoints including:
    /api/workspaces (Create, List workspaces)
    /api/workspaces/{workspaceId} (Get, Update, Delete)
    /api/workspaces/{workspaceId}/environments (Manage Environment bindings)
    /api/workspaces/{workspaceId}/designs (Manage Design bindings)
  • Standardized Error Responses: Added consistent 400, 401, 404, 500 error responses with detailed descriptions and errorResponse schema.
  • Improved Parameters: Added workspaceFilter parameter for filtering assigned/unassigned resources in relationship endpoints.

Environment Construct (environment/v1beta1)

  • Enhanced Documentation: Added detailed descriptions for all endpoints including:
    /api/environments (Create, List environments)
    /api/environments/{environmentId} (Get, Update, Delete)
    /api/environments/{environmentId}/connections (Manage Connection bindings)
  • Standardized Error Responses: Added consistent 400, 401, 404, 500 error responses matching workspace pattern.
  • Schema Updates: Added environmentConnectionMapping, environmentUpdatePayload, and connectionPage schemas.
  • Improved Parameters: Added environmentFilter parameter for filtering assigned/unassigned connections.

This PR fixes #545

Signed commits

  • Yes, I signed my commits.

…e documentation

Signed-off-by: 1012Charan <charanvengala@gmail.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @1012Charan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly upgrades the OpenAPI schemas for Meshery's workspace and environment constructs. The primary goal is to provide a much richer and more consistent API documentation experience by adding extensive descriptions to endpoints, standardizing error handling, and improving parameter definitions. These changes aim to make the API more intuitive and easier for developers to understand and integrate with, ultimately enhancing the overall developer experience.

Highlights

  • Enhanced API Documentation: Comprehensive descriptions have been added for all endpoints related to Workspaces and Environments, including detailed overviews, key concepts, use cases, and links to relevant documentation.
  • Standardized Error Responses: Consistent 400, 401, 404, and 500 error responses are now defined across the API schemas, each with detailed descriptions and a reference to a new errorResponse schema for uniformity.
  • Improved Parameter Definitions: New and refined parameter definitions, such as workspaceFilter and environmentFilter, have been introduced to allow for more granular filtering of assigned/unassigned resources in relationship endpoints.
  • Schema Updates: New schemas like environmentPayload, environmentUpdatePayload, environmentPage, connectionPage, workspacePayload, workspaceUpdatePayload, workspacePage, and designsPage have been added to support the enhanced API definitions.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly enhances the OpenAPI schemas for the workspace and environment APIs. The documentation for endpoints, parameters, and schemas is now much more comprehensive, which is a great improvement for API consumers. The error responses have also been standardized.

My review includes a few suggestions to improve API consistency. Specifically, for both environment and workspace resources, the GET operation for a single resource includes an orgIDQuery parameter for scoping, but the PUT and DELETE operations do not. While PUT includes the organization ID in the body, DELETE has no organization scope in the request at all. I've suggested adding the orgIDQuery parameter to these operations for consistency and to strengthen the security posture by explicitly scoping all requests.

Comment on lines +250 to +251
parameters:
- $ref: "#/components/parameters/environmentId"
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.

medium

For consistency with the get operation on this path, consider adding the orgIDQuery parameter here as well. While the organization_id is present in the request body, having the organization scope in the query parameters for all single-resource operations improves API consistency and can simplify routing and initial authorization logic.

      parameters:
        - $ref: "#/components/parameters/environmentId"
        - $ref: "#/components/parameters/orgIDQuery"

Comment on lines +298 to +299
parameters:
- $ref: "#/components/parameters/environmentId"
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.

medium

For consistency and improved security, it's recommended to add the orgIDQuery parameter to this delete operation. The get operation for a single environment includes it, and requiring it here would ensure that all operations on a specific environment are explicitly scoped to an organization in the request itself. This prevents the backend from having to look up the resource just to determine its parent organization for authorization checks.

      parameters:
        - $ref: "#/components/parameters/environmentId"
        - $ref: "#/components/parameters/orgIDQuery"

Comment on lines 261 to +262
parameters:
- name: id
in: path
required: true
schema:
type: string
- $ref: "#/components/parameters/workspaceId"
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.

medium

For consistency with the get operation on this path, consider adding the orgIDQuery parameter here as well. While the organization_id is present in the request body, having the organization scope in the query parameters for all single-resource operations improves API consistency and can simplify routing and initial authorization logic.

      parameters:
        - $ref: "#/components/parameters/workspaceId"
        - $ref: "#/components/parameters/orgIDQuery"

Comment on lines 315 to +316
parameters:
- name: id
in: path
required: true
schema:
type: string
- $ref: "#/components/parameters/workspaceId"
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.

medium

For consistency and improved security, it's recommended to add the orgIDQuery parameter to this delete operation. The get operation for a single workspace includes it, and requiring it here would ensure that all operations on a specific workspace are explicitly scoped to an organization in the request itself. This prevents the backend from having to look up the resource just to determine its parent organization for authorization checks.

      parameters:
        - $ref: "#/components/parameters/workspaceId"
        - $ref: "#/components/parameters/orgIDQuery"

"401":
$ref: "#/components/responses/401"
"500":
$ref: "#/components/responses/500"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's be sure to document our MeshKit error schema, then come back to make a reference in each of these.

- $ref: "#/components/parameters/filter"
responses:
"200":
description: Successfully retrieved environments list
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove "successfully" from all aspects of this schema.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: 1012Charan <charanvengala@gmail.com>
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.

Enhance workspace and environment API schemas

2 participants