chore(oas): PascalCase for schemas + remove x-resourceId (#2847)

### What

Rename all JSDoc OAS `@schema` and `$ref: #/components/schemas/` from snake_case to PascalCase, `foo_bar -> FooBar`

Extra scope: Remove `x-resourceId` from JSDoc OAS.

### Why

Classes use PascalCase as a convention but the OAS @schemas describing them were using snake_case. OAS code generators tend to use the schema name when generating typed models.

In order to avoid mismatch between source code, the OAS, and the generated client code, it is advised to align OAS @schemas formatting to the classes they represent.

Extra scope: x-resourceId is not a widely used OAS property. It's current usage in our OAS does not provide additional value. Therefore, we recommend to remove it in order to have one less item to maintain.

### How

Good old search & replace. Regex search to further make sure we didn't miss any.

The scope is limited to `@schema` definition and their usage in `$ref: #/components/schemas/`.

### Test

* Ran OAS validator.
* Ran docs build script.

Expect no visible changes to the documentation.

Resolves: CORE-852, CORE-859
This commit is contained in:
Patrick
2022-12-20 10:58:57 +00:00
committed by GitHub
parent 2e5ceb7950
commit a027d5ff9e
319 changed files with 654 additions and 747 deletions
@@ -17,16 +17,15 @@ export default (fn: handler): RequestHandler => {
}
/**
* @schema multiple_errors
* @schema MultipleErrors
* title: "Multiple Errors"
* x-resourceId: multiple_errors
* type: object
* properties:
* errors:
* type: array
* description: Array of errors
* items:
* $ref: "#/components/schemas/error"
* $ref: "#/components/schemas/Error"
* message:
* type: string
* default: "Provided request body contains errors. Please check the data and retry the request"
@@ -79,9 +79,8 @@ export default () => {
}
/**
* @schema error
* @schema Error
* title: "Response Error"
* x-resourceId: error
* type: object
* properties:
* code:
@@ -65,7 +65,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* user:
* $ref: "#/components/schemas/user"
* $ref: "#/components/schemas/User"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -37,7 +37,7 @@ import _ from "lodash"
* type: object
* properties:
* user:
* $ref: "#/components/schemas/user"
* $ref: "#/components/schemas/User"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -39,7 +39,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* batch_job:
* $ref: "#/components/schemas/batch_job"
* $ref: "#/components/schemas/BatchJob"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -39,7 +39,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* batch_job:
* $ref: "#/components/schemas/batch_job"
* $ref: "#/components/schemas/BatchJob"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -85,7 +85,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* batch_job:
* $ref: "#/components/schemas/batch_job"
* $ref: "#/components/schemas/BatchJob"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -36,7 +36,7 @@
* type: object
* properties:
* batch_job:
* $ref: "#/components/schemas/batch_job"
* $ref: "#/components/schemas/BatchJob"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -242,7 +242,7 @@ import { isDefined } from "medusa-core-utils"
* batch_jobs:
* type: array
* items:
* $ref: "#/components/schemas/batch_job"
* $ref: "#/components/schemas/BatchJob"
* count:
* type: integer
* description: The total number of items available
@@ -52,7 +52,7 @@ import ProductCollectionService from "../../../../services/product-collection"
* type: object
* properties:
* collection:
* $ref: "#/components/schemas/product_collection"
* $ref: "#/components/schemas/ProductCollection"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -62,7 +62,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* collection:
* $ref: "#/components/schemas/product_collection"
* $ref: "#/components/schemas/ProductCollection"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -2,6 +2,7 @@ import { Request, Response } from "express"
import ProductCollectionService from "../../../../services/product-collection"
import { defaultAdminCollectionsRelations } from "."
/**
* @oas [get] /collections/{id}
* operationId: "GetCollectionsCollection"
@@ -40,7 +41,7 @@ import { defaultAdminCollectionsRelations } from "."
* type: object
* properties:
* collection:
* $ref: "#/components/schemas/product_collection"
* $ref: "#/components/schemas/ProductCollection"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -116,7 +116,7 @@ import { Type } from "class-transformer"
* collections:
* type: array
* items:
* $ref: "#/components/schemas/product_collection"
* $ref: "#/components/schemas/ProductCollection"
* count:
* type: integer
* description: The total number of items available
@@ -62,7 +62,7 @@ import ProductCollectionService from "../../../../services/product-collection"
* type: object
* properties:
* collection:
* $ref: "#/components/schemas/product_collection"
* $ref: "#/components/schemas/ProductCollection"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -47,7 +47,7 @@ import { FeatureFlagDecorators } from "../../../../utils/feature-flag-decorators
* currencies:
* type: array
* items:
* $ref: "#/components/schemas/currency"
* $ref: "#/components/schemas/Currency"
* count:
* type: integer
* description: The total number of items available
@@ -55,7 +55,7 @@ import TaxInclusivePricingFeatureFlag from "../../../../loaders/feature-flags/ta
* type: object
* properties:
* currency:
* $ref: "#/components/schemas/currency"
* $ref: "#/components/schemas/Currency"
*/
export default async (req: ExtendedRequest<Currency>, res) => {
const code = req.params.code as string
@@ -77,7 +77,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* customer_group:
* $ref: "#/components/schemas/customer_group"
* $ref: "#/components/schemas/CustomerGroup"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -50,7 +50,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* customer_group:
* $ref: "#/components/schemas/customer_group"
* $ref: "#/components/schemas/CustomerGroup"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -77,7 +77,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* customer_group:
* $ref: "#/components/schemas/customer_group"
* $ref: "#/components/schemas/CustomerGroup"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -42,7 +42,7 @@ import CustomerController from "../../../../controllers/customers"
* customers:
* type: array
* items:
* $ref: "#/components/schemas/customer"
* $ref: "#/components/schemas/Customer"
* count:
* type: integer
* description: The total number of items available
@@ -43,7 +43,7 @@ import { FindParams } from "../../../../types/common"
* type: object
* properties:
* customer_group:
* $ref: "#/components/schemas/customer_group"
* $ref: "#/components/schemas/CustomerGroup"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -132,7 +132,7 @@ import { Type } from "class-transformer"
* customer_groups:
* type: array
* items:
* $ref: "#/components/schemas/customer_group"
* $ref: "#/components/schemas/CustomerGroup"
* count:
* type: integer
* description: The total number of items available
@@ -63,7 +63,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* customer_group:
* $ref: "#/components/schemas/customer_group"
* $ref: "#/components/schemas/CustomerGroup"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -83,7 +83,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* customer:
* $ref: "#/components/schemas/customer"
* $ref: "#/components/schemas/Customer"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -43,7 +43,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* customer:
* $ref: "#/components/schemas/customer"
* $ref: "#/components/schemas/Customer"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -48,7 +48,7 @@ import customerController from "../../../../controllers/customers"
* customers:
* type: array
* items:
* $ref: "#/components/schemas/customer"
* $ref: "#/components/schemas/Customer"
* count:
* type: integer
* description: The total number of items available
@@ -97,7 +97,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* customer:
* $ref: "#/components/schemas/customer"
* $ref: "#/components/schemas/Customer"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -43,7 +43,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* discount:
* $ref: "#/components/schemas/discount"
* $ref: "#/components/schemas/Discount"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -74,7 +74,7 @@ import { FindParams } from "../../../../types/common"
* type: object
* properties:
* discount:
* $ref: "#/components/schemas/discount"
* $ref: "#/components/schemas/Discount"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -92,7 +92,7 @@ import { FindParams } from "../../../../types/common"
* type: object
* properties:
* discount:
* $ref: "#/components/schemas/discount"
* $ref: "#/components/schemas/Discount"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -152,7 +152,7 @@ import { FindParams } from "../../../../types/common"
* value: 10,
* allocation: AllocationType.ITEM
* },
* regions: ['reg_XXXXXXXX'],
* regions: ["reg_XXXXXXXX"],
* is_dynamic: false,
* is_disabled: false
* })
@@ -172,7 +172,7 @@ import { FindParams } from "../../../../types/common"
* "value": 10,
* "allocation": "item"
* },
* "regions": ['reg_XXXXXXXX']
* "regions": ["reg_XXXXXXXX"]
* }'
* security:
* - api_token: []
@@ -188,7 +188,7 @@ import { FindParams } from "../../../../types/common"
* type: object
* properties:
* discount:
* $ref: "#/components/schemas/discount"
* $ref: "#/components/schemas/Discount"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -59,7 +59,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* discount:
* $ref: "#/components/schemas/discount"
* $ref: "#/components/schemas/Discount"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -57,7 +57,7 @@ import { FindParams } from "../../../../types/common"
* default: true
* discount:
* description: The Discount to which the condition used to belong
* $ref: "#/components/schemas/discount"
* $ref: "#/components/schemas/Discount"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -42,7 +42,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* discount:
* $ref: "#/components/schemas/discount"
* $ref: "#/components/schemas/Discount"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -73,7 +73,7 @@ import { FindParams } from "../../../../types/common"
* type: object
* properties:
* discount:
* $ref: "#/components/schemas/discount"
* $ref: "#/components/schemas/Discount"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -43,7 +43,7 @@ import { FindParams } from "../../../../types/common"
* type: object
* properties:
* discount_condition:
* $ref: "#/components/schemas/discount_condition"
* $ref: "#/components/schemas/DiscountCondition"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -42,7 +42,7 @@ import { FindParams } from "../../../../types/common"
* type: object
* properties:
* discount:
* $ref: "#/components/schemas/discount"
* $ref: "#/components/schemas/Discount"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -42,7 +42,7 @@ import { FindParams } from "../../../../types/common"
* type: object
* properties:
* discount:
* $ref: "#/components/schemas/discount"
* $ref: "#/components/schemas/Discount"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -71,7 +71,7 @@ import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean"
* discounts:
* type: array
* items:
* $ref: "#/components/schemas/discount"
* $ref: "#/components/schemas/Discount"
* count:
* type: integer
* description: The total number of items available
@@ -42,7 +42,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* discount:
* $ref: "#/components/schemas/discount"
* $ref: "#/components/schemas/Discount"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -87,7 +87,7 @@ import { FindParams } from "../../../../types/common"
* type: object
* properties:
* discount:
* $ref: "#/components/schemas/discount"
* $ref: "#/components/schemas/Discount"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -162,7 +162,7 @@ import { FindParams } from "../../../../types/common"
* type: object
* properties:
* discount:
* $ref: "#/components/schemas/discount"
* $ref: "#/components/schemas/Discount"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -25,6 +25,7 @@ import { AddressPayload } from "../../../../types/common"
import { DraftOrderCreateProps } from "../../../../types/draft-orders"
import { validator } from "../../../../utils/validator"
import { IsType } from "../../../../utils/validators/is-type"
/**
* @oas [post] /draft-orders
* operationId: "PostDraftOrders"
@@ -53,12 +54,12 @@ import { IsType } from "../../../../utils/validators/is-type"
* billing_address:
* description: "The Address to be used for billing purposes."
* anyOf:
* - $ref: "#/components/schemas/address_fields"
* - $ref: "#/components/schemas/AddressFields"
* - type: string
* shipping_address:
* description: "The Address to be used for shipping."
* anyOf:
* - $ref: "#/components/schemas/address_fields"
* - $ref: "#/components/schemas/AddressFields"
* - type: string
* items:
* description: The Line Items that have been received.
@@ -181,7 +182,7 @@ import { IsType } from "../../../../utils/validators/is-type"
* type: object
* properties:
* draft_order:
* $ref: "#/components/schemas/draft-order"
* $ref: "#/components/schemas/DraftOrder"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -82,7 +82,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* draft_order:
* $ref: "#/components/schemas/draft-order"
* $ref: "#/components/schemas/DraftOrder"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -48,7 +48,7 @@ import { MedusaError } from "medusa-core-utils"
* type: object
* properties:
* draft_order:
* $ref: "#/components/schemas/draft-order"
* $ref: "#/components/schemas/DraftOrder"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -46,7 +46,7 @@ import { DraftOrder } from "../../../.."
* type: object
* properties:
* draft_order:
* $ref: "#/components/schemas/draft-order"
* $ref: "#/components/schemas/DraftOrder"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -53,7 +53,7 @@ import { validator } from "../../../../utils/validator"
* draft_orders:
* type: array
* items:
* $ref: "#/components/schemas/draft-order"
* $ref: "#/components/schemas/DraftOrder"
* count:
* type: integer
* description: The total number of items available
@@ -49,7 +49,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/draft-order"
* $ref: "#/components/schemas/DraftOrder"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -19,6 +19,7 @@ import { CartUpdateProps } from "../../../../types/cart"
import { AddressPayload } from "../../../../types/common"
import { validator } from "../../../../utils/validator"
import { IsType } from "../../../../utils/validators/is-type"
/**
* @oas [post] /admin/draft-orders/{id}
* operationId: PostDraftOrdersDraftOrder
@@ -49,12 +50,12 @@ import { IsType } from "../../../../utils/validators/is-type"
* billing_address:
* description: "The Address to be used for billing purposes."
* anyOf:
* - $ref: "#/components/schemas/address_fields"
* - $ref: "#/components/schemas/AddressFields"
* - type: string
* shipping_address:
* description: "The Address to be used for shipping."
* anyOf:
* - $ref: "#/components/schemas/address_fields"
* - $ref: "#/components/schemas/AddressFields"
* - type: string
* discounts:
* description: "An array of Discount codes to add to the Draft Order."
@@ -109,7 +110,7 @@ import { IsType } from "../../../../utils/validators/is-type"
* type: object
* properties:
* draft_order:
* $ref: "#/components/schemas/draft-order"
* $ref: "#/components/schemas/DraftOrder"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -75,7 +75,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* draft_order:
* $ref: "#/components/schemas/draft-order"
* $ref: "#/components/schemas/DraftOrder"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -72,7 +72,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* gift_card:
* $ref: "#/components/schemas/gift_card"
* $ref: "#/components/schemas/GiftCard"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -38,7 +38,7 @@ import { defaultAdminGiftCardFields, defaultAdminGiftCardRelations } from "./"
* type: object
* properties:
* gift_card:
* $ref: "#/components/schemas/gift_card"
* $ref: "#/components/schemas/GiftCard"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -48,7 +48,7 @@ import { isDefined } from "medusa-core-utils"
* gift_cards:
* type: array
* items:
* $ref: "#/components/schemas/gift_card"
* $ref: "#/components/schemas/GiftCard"
* count:
* type: integer
* description: The total number of items available
@@ -72,7 +72,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* gift_card:
* $ref: "#/components/schemas/gift_card"
* $ref: "#/components/schemas/GiftCard"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -38,7 +38,7 @@ import InviteService from "../../../../services/invite"
* invites:
* type: array
* items:
* $ref: "#/components/schemas/invite"
* $ref: "#/components/schemas/Invite"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -69,7 +69,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* note:
* $ref: "#/components/schemas/note"
* $ref: "#/components/schemas/Note"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -38,7 +38,7 @@ import NoteService from "../../../../services/note"
* type: object
* properties:
* note:
* $ref: "#/components/schemas/note"
* $ref: "#/components/schemas/Note"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -47,7 +47,7 @@ import { validator } from "../../../../utils/validator"
* notes:
* type: array
* items:
* $ref: "#/components/schemas/note"
* $ref: "#/components/schemas/Note"
* count:
* type: integer
* description: The total number of items available
@@ -58,7 +58,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* note:
* $ref: "#/components/schemas/note"
* $ref: "#/components/schemas/Note"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -59,7 +59,7 @@ import { validator } from "../../../../utils/validator"
* notifications:
* type: array
* items:
* $ref: "#/components/schemas/notification"
* $ref: "#/components/schemas/Notification"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -4,8 +4,7 @@ import {
} from "."
import { EntityManager } from "typeorm"
import { IsOptional } from "class-validator"
import { IsString } from "class-validator"
import { IsOptional, IsString } from "class-validator"
import { Notification } from "../../../../models"
import { NotificationService } from "../../../../services"
import { validator } from "../../../../utils/validator"
@@ -57,7 +56,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* notification:
* $ref: "#/components/schemas/notification"
* $ref: "#/components/schemas/Notification"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -42,8 +42,8 @@ import {
* const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
* // must be previously logged in or use api token
* medusa.admin.orderEdits.addLineItem(order_edit_id, {
* variant_id,
* quantity
* variant_id,
* quantity
* })
* .then(({ order_edit }) => {
* console.log(order_edit.id)
@@ -69,7 +69,7 @@ import {
* type: object
* properties:
* order_edit:
* $ref: "#/components/schemas/order_edit"
* $ref: "#/components/schemas/OrderEdit"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -44,7 +44,7 @@ import {
* type: object
* properties:
* order_edit:
* $ref: "#/components/schemas/order_edit"
* $ref: "#/components/schemas/OrderEdit"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -44,7 +44,7 @@ import {
* type: object
* properties:
* order_edit:
* $ref: "#/components/schemas/order_edit"
* $ref: "#/components/schemas/OrderEdit"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -59,7 +59,7 @@ import {
* type: object
* properties:
* order_edit:
* $ref: "#/components/schemas/order_edit"
* $ref: "#/components/schemas/OrderEdit"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -1,7 +1,6 @@
import { EntityManager } from "typeorm"
import { OrderEditService } from "../../../../services"
import { Request, Response } from "express"
import { IsNumber } from "class-validator"
import {
defaultOrderEditFields,
defaultOrderEditRelations,
@@ -46,7 +45,7 @@ import {
* type: object
* properties:
* order_edit:
* $ref: "#/components/schemas/order_edit"
* $ref: "#/components/schemas/OrderEdit"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -42,7 +42,7 @@ import { FindParams } from "../../../../types/common"
* type: object
* properties:
* order_edit:
* $ref: "#/components/schemas/order_edit"
* $ref: "#/components/schemas/OrderEdit"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -47,7 +47,7 @@ import { IsOptional, IsString } from "class-validator"
* properties:
* order_edits:
* type: array
* $ref: "#/components/schemas/order_edit"
* $ref: "#/components/schemas/OrderEdit"
* count:
* type: integer
* description: The total number of items available
@@ -1,5 +1,5 @@
import { EntityManager } from "typeorm"
import { IsOptional, IsString, IsObject } from "class-validator"
import { IsOptional, IsString } from "class-validator"
import {
OrderEditService,
OrderService,
@@ -49,7 +49,7 @@ import { PaymentCollectionType } from "../../../../models"
* type: object
* properties:
* order_edit:
* $ref: "#/components/schemas/order_edit"
* $ref: "#/components/schemas/OrderEdit"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -61,7 +61,7 @@ import {
* type: object
* properties:
* order_edit:
* $ref: "#/components/schemas/order_edit"
* $ref: "#/components/schemas/OrderEdit"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -61,7 +61,7 @@ import {
* type: object
* properties:
* order_edit:
* $ref: "#/components/schemas/order_edit"
* $ref: "#/components/schemas/OrderEdit"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -60,7 +60,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -39,7 +39,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -43,7 +43,7 @@ import { MedusaError } from "medusa-core-utils"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -48,7 +48,7 @@ import { MedusaError } from "medusa-core-utils"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -48,7 +48,7 @@ import { MedusaError } from "medusa-core-utils"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -43,7 +43,7 @@ import { MedusaError } from "medusa-core-utils"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -41,7 +41,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -43,7 +43,7 @@ import { MedusaError } from "medusa-core-utils"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -41,7 +41,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -39,7 +39,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -66,7 +66,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -117,7 +117,7 @@ import { validator } from "../../../../utils/validator"
* shipping_address:
* type: object
* description: "An optional shipping address to send the claim to. Defaults to the parent order's shipping address"
* $ref: "#/components/schemas/address"
* $ref: "#/components/schemas/Address"
* refund_amount:
* description: The amount to refund the Customer when the Claim type is `refund`.
* type: integer
@@ -175,7 +175,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -98,7 +98,7 @@ import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -75,7 +75,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -75,7 +75,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -152,7 +152,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -56,7 +56,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -56,7 +56,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -38,7 +38,7 @@ import { OrderService } from "../../../../services"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -185,7 +185,7 @@ import { pick } from "lodash"
* orders:
* type: array
* items:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* count:
* type: integer
* description: The total number of items available
@@ -42,7 +42,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -78,7 +78,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -126,7 +126,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -142,7 +142,7 @@ import { EntityManager } from "typeorm"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -36,16 +36,16 @@ import { validator } from "../../../../utils/validator"
* billing_address:
* description: Billing address
* anyOf:
* - $ref: "#/components/schemas/address_fields"
* - $ref: "#/components/schemas/AddressFields"
* shipping_address:
* description: Shipping address
* anyOf:
* - $ref: "#/components/schemas/address_fields"
* - $ref: "#/components/schemas/AddressFields"
* items:
* description: The Line Items for the order
* type: array
* items:
* $ref: "#/components/schemas/line_item"
* $ref: "#/components/schemas/LineItem"
* region:
* description: ID of the region where the order belongs
* type: string
@@ -53,7 +53,7 @@ import { validator } from "../../../../utils/validator"
* description: Discounts applied to the order
* type: array
* items:
* $ref: "#/components/schemas/discount"
* $ref: "#/components/schemas/Discount"
* customer_id:
* description: ID of the customer
* type: string
@@ -86,7 +86,7 @@ import { validator } from "../../../../utils/validator"
* items:
* type: array
* items:
* $ref: "#/components/schemas/line_item"
* $ref: "#/components/schemas/LineItem"
* description: Items to ship
* no_notification:
* description: A flag to indicate if no notifications should be emitted related to the updated order.
@@ -127,7 +127,7 @@ import { validator } from "../../../../utils/validator"
* type: object
* properties:
* order:
* $ref: "#/components/schemas/order"
* $ref: "#/components/schemas/Order"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -41,7 +41,7 @@ import { FindParams } from "../../../../types/common"
* type: object
* properties:
* payment_collection:
* $ref: "#/components/schemas/payment_collection"
* $ref: "#/components/schemas/PaymentCollection"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -39,7 +39,7 @@ import { PaymentCollectionService } from "../../../../services"
* type: object
* properties:
* payment_collection:
* $ref: "#/components/schemas/payment_collection"
* $ref: "#/components/schemas/PaymentCollection"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -59,7 +59,7 @@ import { PaymentCollectionService } from "../../../../services"
* type: object
* properties:
* payment_collection:
* $ref: "#/components/schemas/payment_collection"
* $ref: "#/components/schemas/PaymentCollection"
* "400":
* $ref: "#/components/responses/400_error"
* "401":
@@ -38,7 +38,7 @@ import { PaymentService } from "../../../../services"
* type: object
* properties:
* payment:
* $ref: "#/components/schemas/payment"
* $ref: "#/components/schemas/Payment"
* "400":
* $ref: "#/components/responses/400_error"
* "401":

Some files were not shown because too many files have changed in this diff Show More