docs(api-spec): switch update endpoints to PATCH semantics#2892
docs(api-spec): switch update endpoints to PATCH semantics#2892aofei merged 1 commit intogoplus:devfrom
PATCH semantics#2892Conversation
Summary of ChangesHello, 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 updates the API documentation to reflect more appropriate HTTP semantics for update operations. By transitioning from Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request correctly updates the OpenAPI specification to use PATCH instead of PUT for several update endpoints, which is a good semantic change for partial updates.
However, this is a breaking API change, and the PR is critically incomplete because the client-side code that consumes these endpoints has not been updated. This will cause all update functionality to fail once the backend implements these changes.
The following changes are required:
- A
patchmethod needs to be added to theClientclass inspx-gui/src/apis/common/client.ts. It can be implemented similarly to the existingputmethod. - All
update...functions in thespx-gui/src/apis/directory that correspond to the changed endpoints must be updated to useclient.patchinstead ofclient.put. This affectsuser.ts,project.ts,asset.ts,course.ts, andcourse-series.ts.
I have added comments on each affected endpoint in docs/openapi.yaml to point to the specific client-side function that needs to be updated.
There was a problem hiding this comment.
Pull request overview
Updates the OpenAPI specification to document partial-update semantics for several “update” endpoints by switching from PUT to PATCH and loosening request-body required fields. This is intended to allow clients to send partial updates without failing schema validation.
Changes:
- Switch update operations for user, project, asset, course, and course-series endpoints from
puttopatch. - Replace
required: [...]request-body constraints withminProperties: 1to permit partial update payloads. - Keep paths and response schemas unchanged.
Comments suppressed due to low confidence (5)
docs/openapi.yaml:823
- This operation is now documented as
PATCH, but the GUI client currently usesPUT /asset/{id}(spx-gui/src/apis/asset.ts). If PATCH is intended, the client (and backend, if applicable) should be updated, otherwise keepput(or list both) to match deployed behavior.
patch:
tags:
- Assets
summary: Update an asset
description: |
docs/openapi.yaml:1011
- This operation is now documented as
PATCH, but the GUI client currently usesPUT /course/{id}(spx-gui/src/apis/course.ts). Please align the OpenAPI method with the actually supported API method(s) so generated clients and docs don’t diverge.
patch:
tags:
- Courses
summary: Update a course
description: |
docs/openapi.yaml:1192
- This operation is now documented as
PATCH, but the GUI client currently usesPUT /course-series/{id}(spx-gui/src/apis/course-series.ts). If PATCH is the new contract, consider updating existing clients or documenting both methods for compatibility.
patch:
tags:
- Course Series
summary: Update a course series
description: |
docs/openapi.yaml:103
- The spec switches this endpoint to
PATCH, but the existing GUI client still callsPUT /user(seespx-gui/src/apis/user.ts). If the server still expects PUT, this OpenAPI change will be incorrect for consumers; consider documenting bothputandpatchduring a transition or updating the client/backend in the same change set.
patch:
tags:
- Users
summary: Update the authenticated user
description: Update the profile information of the authenticated user.
docs/openapi.yaml:381
- This operation is now documented as
PATCH, but the GUI client currently usesPUT /project/{owner}/{name}(spx-gui/src/apis/project.ts). Please ensure the backend actually supports PATCH (or document both methods) to avoid a spec/client mismatch.
patch:
tags:
- Projects
summary: Update a project
description: Update the details of a specific project.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Clean, focused change that correctly aligns the API spec with partial-update semantics. The two noteworthy points are:
|
- Change `PUT` to `PATCH` for user, project, asset, course, and course-series update endpoints in `docs/openapi.yaml` - Replace required request fields with `minProperties: 1` on all updated bodies so clients can send partial updates without breaking schema validation - Keep response schemas and endpoint paths unchanged to align with API docs only Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
- Add `client.patch` and remove obsolete `client.put` - Update user, project, asset, course, and course-series update calls Updates goplus#2892 Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
- Add `client.patch` and remove obsolete `client.put` - Update user, project, asset, course, and course-series update calls Updates goplus#2892 Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
- Add `client.patch` and remove obsolete `client.put` - Update user, project, asset, course, and course-series update calls Updates goplus#2892 Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
- Add `client.patch` and remove obsolete `client.put` - Update user, project, asset, course, and course-series update calls Updates goplus#2892 Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
PUTtoPATCHfor user, project, asset, course, and course-series update endpoints indocs/openapi.yamlminProperties: 1on all updated bodies so clients can send partial updates without breaking schema validation