Repository navigation
refactor: openapi dedupe errors - #133
oericdacosta wants to merge 2 commits into
Conversation
f6454a6 to
c47f76b
Compare
|
Thank you for the contribution! Some comments after going through the PR:
Given the file has evolved quite a bit, if you want to still keep this PR open, it'd be great to resolve the conflicts so we can take a look at the updated deltas again! Otherwise, we can close this PR and reopen a fresh one for the first point listed above. |
c47f76b to
2fbf558
Compare
|
@jingyli Thanks for the detailed review and feedback! I have just rebased the branch to resolve all conflicts and updated the PR. Following your suggestion, I have completely removed the error response standardization from this PR, as it's already being handled elsewhere. The PR is now strictly focused on the first point: deduplicating the common header parameters by moving them to the path level. Let me know if the update look good to you! |
There was a problem hiding this comment.
@oericdacosta this file seems a bit out-of-scope for the PR intent of deduplication. Please remove it from the PR
c68b7ef to
584decb
Compare
584decb to
3211c0f
Compare
|
@damaz91 Apologies for that! The cart.complete_req.json file slipped in accidentally during my local commits. I have just removed it from the branch and updated the PR. Thanks for catching that! |
|
Thanks for sticking with this one, @oericdacosta. You turned it around promptly every time we asked, including dropping the error-response work when @jingyli pointed at Two things have moved upstream since the last round that between them settle it. The parameters this PR hoists are being deleted. #716 (open, same file) removes This file is becoming generated output. RFC #800 proposes compiling the REST binding from the JSON Schema sources via A smaller supporting point on the refactor itself. The shipped spec has 11 paths and 13 operations, and only two paths carry more than one operation ( Worth flagging for completeness: the June rebase looks like it resolved conflicts by taking the branch's copy of the file wholesale. The current head is missing four paths ( Closing this one. The discussion here is what prompted me to go measure the duplication and find the disabled linter, so it was not wasted. If you would like to keep going, there is a better-shaped version of this same idea. Once Thanks again for the patience across the review cycle. |
refactor: deduplicate parameters and standardize error responses
Description
This PR refactors the Shopping Service OpenAPI specification source/services/shopping/openapi.json to improve maintainability and strictly follow the DRY principle.
Key Changes:
Authorization,X-API-Key,Request-Id) from individual operations to the path level. This significantly reduces redundancy across endpoints like/checkout-sessionsand/carts.error_responseschema and added standard HTTP error responses (400, 401, 404, 500) to all operations, referencing shared definitions incomponents/responses.These changes make the OpenAPI spec more concise, easier to read, and ensure consistent error handling documentation across the API.
Type of change
Please delete options that are not relevant.
Is this a Breaking Change or Removal?
If you checked "Breaking change" above, or if you are removing any schema
files or fields:
!to my PR title (e.g.,feat!: remove field).Checklist