Feature/lab 1915 cm update open api to support multi template#152
Feature/lab 1915 cm update open api to support multi template#152JagdishKhunti wants to merge 6 commits intomainfrom
Conversation
…-add-open-api-specification-for-the-get-template-list-endpoint LAB-1920 Add POST Cloud Matrix Assessment template endpoint specification.
- Update OpenAPI spec to support retrieving Cloud Matrix templates by name:
- Add a required path parameter `templateName`, change the GET path to `/Api/CloudMatrix/Template/{templateName}` (with updated operationId, descriptions and examples), and adjust response summaries.
- Preserve the POST endpoint for creating/updating templates.
- Also bump the TypeScript SDK package version from 3.2.0 to 3.2.1.
…e/LAB-1922A_Update-Get-Template-EndPoint LAB-1922A: Added templateName GET route and bump SDK version
There was a problem hiding this comment.
Pull request overview
Updates the Data Gateway OpenAPI spec to support multiple Cloud Matrix templates (named retrieval + upload), and bumps the TypeScript SDK package version.
Changes:
- Bump
@shi-corp/sdk-data-gatewayversion from3.2.0to3.2.1 - Add
templateNamepath parameter and new schemas for template naming/upload requests - Replace the CloudMatrix template GET route with a templated route and add a POST endpoint for uploading/overwriting templates
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/dataGateway/TypeScript/package.json |
Bumps SDK version to publish updated generated client/spec changes. |
specs/Data-Gateway.json |
Adds multi-template support in CloudMatrix API (named GET, upload POST, new parameter/schemas). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "/Api/CloudMatrix/Template/{templateName}": { | ||
| "get": { | ||
| "description": "Get a default assessment schema object as schema structure reference. \n\nThis endpoint requires the `CloudMatrix.Read`, `CloudMatrix.Read.Del`, `CloudMatrix.Read.All`, `CloudMatrix.ReadWrite`, or `CloudMatrix.ReadWrite.All` scope (permission).", | ||
| "operationId": "/Api/CloudMatrix/Template/Get", | ||
| "description": "Retrieves the specified Cloud Matrix assessment template by template name. \n\nThis endpoint requires the `CloudMatrix.Read`, `CloudMatrix.Read.Del`, `CloudMatrix.Read.All`, `CloudMatrix.ReadWrite`, or `CloudMatrix.ReadWrite.All` scope (permission).", | ||
| "operationId": "/Api/CloudMatrix/Template/:templateName/Get", | ||
| "parameters": [ |
There was a problem hiding this comment.
Changing the GET route from /Api/CloudMatrix/Template to /Api/CloudMatrix/Template/{templateName} (and leaving /Api/CloudMatrix/Template without a GET) is a breaking API change for any existing clients that retrieve the default template. Consider keeping the original GET endpoint for the default template (or aliasing it) and adding the new templated route in addition, rather than replacing it.
| "templateName": { | ||
| "description": "Name of the Cloud Matrix template to retrieve.", | ||
| "in": "path", | ||
| "name": "templateName", | ||
| "required": true, | ||
| "schema": { | ||
| "$ref": "#/components/schemas/CloudMatrix.TemplateName" | ||
| }, | ||
| "examples": { | ||
| "Valid Template Name": { | ||
| "summary": "Example Valid Template Name", | ||
| "description": "An example string of a valid template name.", | ||
| "value": "Microsoft Enterprise" | ||
| } | ||
| } |
There was a problem hiding this comment.
templateName is a path parameter, but the provided example value contains a space ("Microsoft Enterprise"). This is valid only if clients URL-encode it, which is easy to miss and can cause interoperability issues in generated SDKs. Consider clarifying in the parameter description/examples that the value must be URL-encoded in the path (or use a URL-safe identifier such as a templateId/slug).
| "responses": { | ||
| "200": { | ||
| "description": "The default assessment schema object.", | ||
| "description": "The requested assessment template object.", |
There was a problem hiding this comment.
This CloudMatrix GET endpoint only documents 200 and 500 responses. Other CloudMatrix GET endpoints in this spec include a 400 response (e.g., /Api/CloudMatrix/Dashboard at specs/Data-Gateway.json:8999-9004). For consistency and to document invalid input cases (such as an invalid templateName), add the standard 400 response reference here too.
| "name": "@shi-corp/sdk-data-gateway", | ||
| "version": "3.2.0", | ||
| "version": "3.2.1", | ||
| "type": "module", |
There was a problem hiding this comment.
The PR description says the only change is a version bump, but this PR also includes substantial OpenAPI spec changes (new CloudMatrix template endpoints/schemas). Please update the PR description to reflect the API/spec changes, or split the version bump into a separate PR.
| { | ||
| "name": "@shi-corp/sdk-data-gateway", | ||
| "version": "3.2.0", | ||
| "version": "3.2.1", |
There was a problem hiding this comment.
The SDK version is being bumped as a patch (3.2.0 → 3.2.1), but the OpenAPI spec changes in this PR appear to be breaking (the GET endpoint moved from /Api/CloudMatrix/Template to /Api/CloudMatrix/Template/{templateName} and the old path no longer supports GET). Either restore backwards compatibility (e.g., keep the original GET endpoint) or bump the package version according to semver for a breaking change.
| "version": "3.2.1", | |
| "version": "4.0.0", |
@shi-corp/sdk-data-gatewaypackage, incrementing its version from 3.2.0 to 3.2.1. No other changes are included.