-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(oas): add missing x-codegen + fix schema naming and $ref #3312
Conversation
🦋 Changeset detectedLatest commit: 0378708 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self-review: highlighting noteworthy code changes
@@ -13,6 +13,9 @@ import { joinLevels } from "./utils/join-levels" | |||
* - (path) id=* {string} The ID of the Inventory Item. | |||
* - (query) expand {string} Comma separated list of relations to include in the results. | |||
* - (query) fields {string} Comma separated list of fields to include in the results. | |||
* x-codegen: | |||
* method: retrieve | |||
* queryParams: AdminGetInventoryItemsItemParams |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
medusa/packages/medusa-js/src/resources/admin/inventory-item.ts
Lines 25 to 29 in 194f5e5
retrieve( | |
inventoryItemId: string, | |
query?: AdminGetInventoryItemsItemParams, | |
customHeaders: Record<string, any> = {} | |
): ResponsePromise<AdminInventoryItemsRes> { |
@@ -51,6 +51,9 @@ import { AdminInventoryItemsListWithVariantsAndLocationLevelsRes } from "." | |||
* - (query) height {string} height to search for. | |||
* - (query) width {string} width to search for. | |||
* - (query) requires_shipping {string} requires_shipping to search for. | |||
* x-codegen: | |||
* method: list | |||
* queryParams: AdminGetInventoryItemsParams |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
medusa/packages/medusa-js/src/resources/admin/inventory-item.ts
Lines 85 to 88 in 194f5e5
list( | |
query?: AdminGetInventoryItemsParams, | |
customHeaders: Record<string, any> = {} | |
): ResponsePromise<AdminInventoryItemsListWithVariantsAndLocationLevelsRes> { |
@@ -15,6 +15,9 @@ import { FindParams } from "../../../../types/common" | |||
* - (query) limit=20 {integer} Limit the number of stock locations levels returned. | |||
* - (query) expand {string} Comma separated list of relations to include in the results. | |||
* - (query) fields {string} Comma separated list of fields to include in the results. | |||
* x-codegen: | |||
* method: listLocationLevels | |||
* queryParams: AdminGetInventoryItemsItemLocationLevelsParams |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
medusa/packages/medusa-js/src/resources/admin/inventory-item.ts
Lines 176 to 180 in 194f5e5
listLocationLevels( | |
inventoryItemId: string, | |
query?: AdminGetInventoryItemsItemLocationLevelsParams, | |
customHeaders: Record<string, any> = {} | |
): ResponsePromise<AdminInventoryItemsLocationLevelsRes> { |
@@ -63,6 +63,9 @@ import { | |||
* - (query) limit=20 {integer} Limit the number of Reservations returned. | |||
* - (query) expand {string} (Comma separated) Which fields should be expanded in the product category. | |||
* - (query) fields {string} (Comma separated) Which fields should be included in the product category. | |||
* x-codegen: | |||
* method: list | |||
* queryParams: AdminGetReservationsParams |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
medusa/packages/medusa-js/src/resources/admin/reservations.ts
Lines 36 to 39 in 194f5e5
list( | |
query?: AdminGetReservationsParams, | |
customHeaders: Record<string, unknown> = {} | |
): ResponsePromise<AdminReservationsListRes> { |
@@ -56,7 +56,7 @@ export default (app) => { | |||
} | |||
|
|||
/** | |||
* @schema AdminPostReservationsReq | |||
* @schema AdminReservationsRes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: schema name was not matching type name
@@ -69,7 +69,7 @@ export type AdminReservationsRes = { | |||
} | |||
|
|||
/** | |||
* @schema AdminGetReservationReservationsReq | |||
* @schema AdminReservationsListRes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: schema name was not matching type name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😄
@@ -40,7 +40,7 @@ import { extendedFindParamsMixin } from "../../../../types/common" | |||
* content: | |||
* application/json: | |||
* schema: | |||
* $ref: "#/components/schemas/AdminGetReservationReservationsReq" | |||
* $ref: "#/components/schemas/AdminReservationsRes" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be AdminReservationsListRes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch 🎣 . Done in efda8f4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What
Add missing x-codegen + fix schema naming and $ref
Why
OAS code generator was missing information to be able to match current JS client.
How
Ensure OAS matches JS client methods.