oas: [1/n] improve oas schemas (#9039)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-09-06 18:52:51 +03:00
1 parent cd909f9db3
commit 0482b7751d
21 files changed
+108 -110

No files matched your search

@@ -36,11 +36,6 @@
* - api_token: [] * - api_token: []
* - cookie_auth: [] * - cookie_auth: []
* - jwt_token: [] * - jwt_token: []
* requestBody:
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/AdminCancelFulfillment"
* x-codeSamples: * x-codeSamples:
* - lang: Shell * - lang: Shell
* label: cURL * label: cURL
@@ -1,7 +1,7 @@
/** /**
* @schema AdminApiKey * @schema AdminApiKey
* type: object * type: object
* description: The api key's details. * description: The API key's details.
* x-schemaName: AdminApiKey * x-schemaName: AdminApiKey
* required: * required:
* - id * - id
@@ -26,39 +26,40 @@
* redacted: * redacted:
* type: string * type: string
* title: redacted * title: redacted
* description: The api key's redacted. * description: The redacted form of the API key's token. This is useful when showing portion of the token.
* example: sk_...123
* title: * title:
* type: string * type: string
* title: title * title: title
* description: The api key's title. * description: The api key's title.
* type: * type:
* type: string * type: string
* description: The api key's type. * description: The api key's type. `secret` is used for a user's API key, whereas `publishable` is used for Publishable API keys.
* enum: * enum:
* - secret * - secret
* - publishable * - publishable
* last_used_at: * last_used_at:
* type: string * type: string
* title: last_used_at * title: last_used_at
* description: The api key's last used at. * description: The date and time the API key was last used.
* format: date-time * format: date-time
* created_by: * created_by:
* type: string * type: string
* title: created_by * title: created_by
* description: The api key's created by. * description: The ID of the user that created the API key, if available.
* created_at: * created_at:
* type: string * type: string
* format: date-time * format: date-time
* title: created_at * title: created_at
* description: The api key's created at. * description: The date and time the API key was created.
* revoked_by: * revoked_by:
* type: string * type: string
* title: revoked_by * title: revoked_by
* description: The api key's revoked by. * description: The ID of the user that revoked the API key, if available.
* revoked_at: * revoked_at:
* type: string * type: string
* title: revoked_at * title: revoked_at
* description: The api key's revoked at. * description: The date and time the API key was revoked. The API key is considered revoked when this property is set.
* format: date-time * format: date-time
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminApiKeyResponse * @schema AdminApiKeyResponse
* type: object * type: object
* description: SUMMARY * description: The API key's details.
* x-schemaName: AdminApiKeyResponse * x-schemaName: AdminApiKeyResponse
* required: * required:
* - api_key * - api_key
@@ -1,26 +1,26 @@
/** /**
* @schema AdminBatchProductRequest * @schema AdminBatchProductRequest
* type: object * type: object
* description: SUMMARY * description: The products to create, update, or delete.
* x-schemaName: AdminBatchProductRequest * x-schemaName: AdminBatchProductRequest
* properties: * properties:
* create: * create:
* type: array * type: array
* description: The product's create. * description: The products to create.
* items: * items:
* $ref: "#/components/schemas/AdminCreateProduct" * $ref: "#/components/schemas/AdminCreateProduct"
* update: * update:
* type: array * type: array
* description: The product's update. * description: The products to update.
* items: * items:
* $ref: "#/components/schemas/AdminUpdateProduct" * $ref: "#/components/schemas/AdminUpdateProduct"
* delete: * delete:
* type: array * type: array
* description: The product's delete. * description: The products to delete.
* items: * items:
* type: string * type: string
* title: delete * title: delete
* description: The delete's details. * description: A product's ID.
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminBatchProductResponse * @schema AdminBatchProductResponse
* type: object * type: object
* description: SUMMARY * description: The details of the products created, updated, or deleted.
* x-schemaName: AdminBatchProductResponse * x-schemaName: AdminBatchProductResponse
* required: * required:
* - created * - created
@@ -10,17 +10,17 @@
* properties: * properties:
* created: * created:
* type: array * type: array
* description: The product's created. * description: The created products
* items: * items:
* $ref: "#/components/schemas/AdminProduct" * $ref: "#/components/schemas/AdminProduct"
* updated: * updated:
* type: array * type: array
* description: The product's updated. * description: The updated products.
* items: * items:
* $ref: "#/components/schemas/AdminProduct" * $ref: "#/components/schemas/AdminProduct"
* deleted: * deleted:
* type: object * type: object
* description: SUMMARY * description: The deleted products' details.
* required: * required:
* - ids * - ids
* - object * - object
@@ -28,19 +28,20 @@
* properties: * properties:
* ids: * ids:
* type: array * type: array
* description: The deleted's ids. * description: The IDs of deleted products.
* items: * items:
* type: string * type: string
* title: ids * title: ids
* description: The id's ids. * description: The ID of a deleted product.
* object: * object:
* type: string * type: string
* title: object * title: object
* description: SUMMARY * description: The name of the deleted objects.
* default: product
* deleted: * deleted:
* type: boolean * type: boolean
* title: deleted * title: deleted
* description: SUMMARY * description: Whether the products were deleted.
* *
*/ */
@@ -1,26 +1,26 @@
/** /**
* @schema AdminBatchProductVariantRequest * @schema AdminBatchProductVariantRequest
* type: object * type: object
* description: SUMMARY * description: The product variants to create, update, or delete.
* x-schemaName: AdminBatchProductVariantRequest * x-schemaName: AdminBatchProductVariantRequest
* properties: * properties:
* create: * create:
* type: array * type: array
* description: The product's create. * description: The product variants to create.
* items: * items:
* $ref: "#/components/schemas/AdminCreateProductVariant" * $ref: "#/components/schemas/AdminCreateProductVariant"
* update: * update:
* type: array * type: array
* description: The product's update. * description: The product variants to update.
* items: * items:
* $ref: "#/components/schemas/AdminUpdateProductVariant" * $ref: "#/components/schemas/AdminUpdateProductVariant"
* delete: * delete:
* type: array * type: array
* description: The product's delete. * description: The product variants to delete.
* items: * items:
* type: string * type: string
* title: delete * title: delete
* description: The delete's details. * description: A product variant's ID.
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminBatchProductVariantResponse * @schema AdminBatchProductVariantResponse
* type: object * type: object
* description: SUMMARY * description: The details of the product variants created, updated, or deleted.
* x-schemaName: AdminBatchProductVariantResponse * x-schemaName: AdminBatchProductVariantResponse
* required: * required:
* - created * - created
@@ -10,17 +10,17 @@
* properties: * properties:
* created: * created:
* type: array * type: array
* description: The product's created. * description: The created product variants.
* items: * items:
* $ref: "#/components/schemas/AdminProductVariant" * $ref: "#/components/schemas/AdminProductVariant"
* updated: * updated:
* type: array * type: array
* description: The product's updated. * description: The updated product variants.
* items: * items:
* $ref: "#/components/schemas/AdminProductVariant" * $ref: "#/components/schemas/AdminProductVariant"
* deleted: * deleted:
* type: object * type: object
* description: SUMMARY * description: The details of the deleted product variants.
* required: * required:
* - ids * - ids
* - object * - object
@@ -28,19 +28,20 @@
* properties: * properties:
* ids: * ids:
* type: array * type: array
* description: The deleted's ids. * description: The IDs of the deleted product variants.
* items: * items:
* type: string * type: string
* title: ids * title: ids
* description: The id's ids. * description: The ID of a deleted variant.
* object: * object:
* type: string * type: string
* title: object * title: object
* description: SUMMARY * description: The name of the deleted objects.
* default: variant
* deleted: * deleted:
* type: boolean * type: boolean
* title: deleted * title: deleted
* description: SUMMARY * description: Whether the product variants were deleted.
* *
*/ */
@@ -32,15 +32,15 @@
* campaign_identifier: * campaign_identifier:
* type: string * type: string
* title: campaign_identifier * title: campaign_identifier
* description: The campaign's campaign identifier. * description: The campaign's identifier.
* starts_at: * starts_at:
* type: string * type: string
* title: starts_at * title: starts_at
* description: The campaign's starts at. * description: The date and time that the campaign starts.
* ends_at: * ends_at:
* type: string * type: string
* title: ends_at * title: ends_at
* description: The campaign's ends at. * description: The date and time that the campaign ends.
* budget: * budget:
* type: object * type: object
* description: The campaign's budget. * description: The campaign's budget.
@@ -57,7 +57,9 @@
* description: The budget's ID. * description: The budget's ID.
* type: * type:
* type: string * type: string
* description: The budget's type. * description: >
* The budget's type. `spend` means the limit is set on the total amount discounted by the campaign's promotions; `usage` means the limit is set on the total
* number of times the campaign's promotions can be used.
* enum: * enum:
* - spend * - spend
* - usage * - usage
@@ -72,7 +74,9 @@
* used: * used:
* type: number * type: number
* title: used * title: used
* description: The budget's used. * description: >
* How much of the budget has been used. If the limit is `spend`, this property holds the total amount discounted so far. If the limit is `usage`, it holds
* the number of times the campaign's promotions have been used so far.
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminCampaignResponse * @schema AdminCampaignResponse
* type: object * type: object
* description: SUMMARY * description: The campaign's details.
* x-schemaName: AdminCampaignResponse * x-schemaName: AdminCampaignResponse
* required: * required:
* - campaign * - campaign
@@ -1,8 +0,0 @@
/**
* @schema AdminCancelFulfillment
* type: object
* description: SUMMARY
* x-schemaName: AdminCancelFulfillment
*
*/
@@ -43,62 +43,63 @@
* - original_shipping_subtotal * - original_shipping_subtotal
* - original_shipping_tax_total * - original_shipping_tax_total
* properties: * properties:
* id:
* type: string
* title: id
* description: The claim's ID.
* order_id: * order_id:
* type: string * type: string
* title: order_id * title: order_id
* description: The claim's order id. * description: The ID of the order associated with the claim.
* claim_items: * claim_items:
* type: array * type: array
* description: The claim's claim items. * description: The order items targetted by the claim.
* items: * items:
* $ref: "#/components/schemas/BaseClaimItem" * $ref: "#/components/schemas/BaseClaimItem"
* additional_items: * additional_items:
* type: array * type: array
* description: The claim's additional items. * description: The outbound or new items of the claim.
* items: {} * items:
* $ref: "#/components/schemas/BaseClaimItem"
* return: * return:
* $ref: "#/components/schemas/Return" * $ref: "#/components/schemas/Return"
* return_id: * return_id:
* type: string * type: string
* title: return_id * title: return_id
* description: The claim's return id. * description: The ID of the associated return.
* no_notification: * no_notification:
* type: boolean * type: boolean
* title: no_notification * title: no_notification
* description: The claim's no notification. * description: Whether the customer should be notified about changes in the claim.
* refund_amount: * refund_amount:
* type: number * type: number
* title: refund_amount * title: refund_amount
* description: The claim's refund amount. * description: The amount to be refunded.
* currency_code: * currency_code:
* type: string * type: string
* title: currency_code * title: currency_code
* description: The claim's currency code. * description: The claim's currency code.
* id:
* type: string
* title: id
* description: The claim's ID.
* region_id: * region_id:
* type: string * type: string
* title: region_id * title: region_id
* description: The claim's region id. * description: The ID of the region associated with the claim.
* customer_id: * customer_id:
* type: string * type: string
* title: customer_id * title: customer_id
* description: The claim's customer id. * description: The ID of the customer associated with the claim's order.
* sales_channel_id: * sales_channel_id:
* type: string * type: string
* title: sales_channel_id * title: sales_channel_id
* description: The claim's sales channel id. * description: The ID of the sales channel the claim's order is created in.
* email: * email:
* type: string * type: string
* title: email * title: email
* description: The claim's email. * description: The email associated with the claim's order.
* format: email * format: email
* display_id: * display_id:
* type: number * type: number
* title: display_id * title: display_id
* description: The claim's display id. * description: The claim's display ID.
* shipping_address: * shipping_address:
* $ref: "#/components/schemas/BaseOrderAddress" * $ref: "#/components/schemas/BaseOrderAddress"
* billing_address: * billing_address:
@@ -147,63 +148,66 @@
* transactions: * transactions:
* type: array * type: array
* description: The claim's transactions. * description: The claim's transactions.
* externalDocs:
* url: https://docs.medusajs.com/v2/resources/commerce-modules/order/transactions
* description: Learn more about transactions of orders and associated models.
* items: * items:
* $ref: "#/components/schemas/BaseOrderTransaction" * $ref: "#/components/schemas/BaseOrderTransaction"
* summary: * summary:
* $ref: "#/components/schemas/BaseOrderSummary" * $ref: "#/components/schemas/BaseOrderSummary"
* metadata: * metadata:
* type: object * type: object
* description: The claim's metadata. * description: The claim's metadata, used to store custom key-value pairs.
* created_at: * created_at:
* type: string * type: string
* format: date-time * format: date-time
* title: created_at * title: created_at
* description: The claim's created at. * description: The claim's creation date.
* updated_at: * updated_at:
* type: string * type: string
* format: date-time * format: date-time
* title: updated_at * title: updated_at
* description: The claim's updated at. * description: The claim's update date.
* original_item_total: * original_item_total:
* type: number * type: number
* title: original_item_total * title: original_item_total
* description: The claim's original item total. * description: The total of the original items in the associated order.
* original_item_subtotal: * original_item_subtotal:
* type: number * type: number
* title: original_item_subtotal * title: original_item_subtotal
* description: The claim's original item subtotal. * description: The subtotal of the original items in the associated order.
* original_item_tax_total: * original_item_tax_total:
* type: number * type: number
* title: original_item_tax_total * title: original_item_tax_total
* description: The claim's original item tax total. * description: The tax total of the original items in the associated order.
* item_total: * item_total:
* type: number * type: number
* title: item_total * title: item_total
* description: The claim's item total. * description: The total of the claim's items.
* item_subtotal: * item_subtotal:
* type: number * type: number
* title: item_subtotal * title: item_subtotal
* description: The claim's item subtotal. * description: The subtotal of the claim's items.
* item_tax_total: * item_tax_total:
* type: number * type: number
* title: item_tax_total * title: item_tax_total
* description: The claim's item tax total. * description: The tax total of the claim's items.
* original_total: * original_total:
* type: number * type: number
* title: original_total * title: original_total
* description: The claim's original total. * description: The associated order's original total.
* original_subtotal: * original_subtotal:
* type: number * type: number
* title: original_subtotal * title: original_subtotal
* description: The claim's original subtotal. * description: The associated order's original subtotal.
* original_tax_total: * original_tax_total:
* type: number * type: number
* title: original_tax_total * title: original_tax_total
* description: The claim's original tax total. * description: The associated order's original tax total.
* total: * total:
* type: number * type: number
* title: total * title: total
* description: The claim's total. * description: The associated order's total.
* subtotal: * subtotal:
* type: number * type: number
* title: subtotal * title: subtotal
@@ -243,15 +247,15 @@
* original_shipping_total: * original_shipping_total:
* type: number * type: number
* title: original_shipping_total * title: original_shipping_total
* description: The claim's original shipping total. * description: The associated order's original shipping total.
* original_shipping_subtotal: * original_shipping_subtotal:
* type: number * type: number
* title: original_shipping_subtotal * title: original_shipping_subtotal
* description: The claim's original shipping subtotal. * description: The associated order's original shipping subtotal.
* original_shipping_tax_total: * original_shipping_tax_total:
* type: number * type: number
* title: original_shipping_tax_total * title: original_shipping_tax_total
* description: The claim's original shipping tax total. * description: The associated order's original shipping tax total.
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminClaimDeleteResponse * @schema AdminClaimDeleteResponse
* type: object * type: object
* description: SUMMARY * description: The details of the deleted claim.
* x-schemaName: AdminClaimDeleteResponse * x-schemaName: AdminClaimDeleteResponse
* required: * required:
* - id * - id
@@ -20,7 +20,7 @@
* deleted: * deleted:
* type: boolean * type: boolean
* title: deleted * title: deleted
* description: Whether the Claim was deleted. * description: Whether the claim was deleted.
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminClaimListResponse * @schema AdminClaimListResponse
* type: object * type: object
* description: SUMMARY * description: The paginated list of claims.
* x-schemaName: AdminClaimListResponse * x-schemaName: AdminClaimListResponse
* required: * required:
* - limit * - limit
@@ -12,18 +12,18 @@
* limit: * limit:
* type: number * type: number
* title: limit * title: limit
* description: The claim's limit. * description: The maximum number of items returned.
* offset: * offset:
* type: number * type: number
* title: offset * title: offset
* description: The claim's offset. * description: The number of items skipped before retrieving the returned items.
* count: * count:
* type: number * type: number
* title: count * title: count
* description: The claim's count. * description: The total number of items.
* claims: * claims:
* type: array * type: array
* description: The claim's claims. * description: The list of claims.
* items: * items:
* $ref: "#/components/schemas/AdminClaim" * $ref: "#/components/schemas/AdminClaim"
* *
@@ -1,7 +1,7 @@
/** /**
* @schema AdminClaimOrderResponse * @schema AdminClaimOrderResponse
* type: object * type: object
* description: SUMMARY * description: The created claim's details.
* x-schemaName: AdminClaimOrderResponse * x-schemaName: AdminClaimOrderResponse
* required: * required:
* - order * - order
@@ -1,7 +1,7 @@
/** /**
* @schema AdminClaimPreviewResponse * @schema AdminClaimPreviewResponse
* type: object * type: object
* description: SUMMARY * description: The details of the claim, as well as a preview of the order when the claim is applied.
* x-schemaName: AdminClaimPreviewResponse * x-schemaName: AdminClaimPreviewResponse
* required: * required:
* - order_preview * - order_preview
@@ -1,7 +1,7 @@
/** /**
* @schema AdminClaimRequestResponse * @schema AdminClaimRequestResponse
* type: object * type: object
* description: SUMMARY * description: The details of the claim, its return, and a preview of the order when the claim is applied.
* x-schemaName: AdminClaimRequestResponse * x-schemaName: AdminClaimRequestResponse
* required: * required:
* - return * - return
@@ -1,7 +1,7 @@
/** /**
* @schema AdminClaimResponse * @schema AdminClaimResponse
* type: object * type: object
* description: SUMMARY * description: The claim's details.
* x-schemaName: AdminClaimResponse * x-schemaName: AdminClaimResponse
* required: * required:
* - claim * - claim
@@ -1,7 +1,7 @@
/** /**
* @schema AdminClaimReturnPreviewResponse * @schema AdminClaimReturnPreviewResponse
* type: object * type: object
* description: SUMMARY * description: The details of the claim's return, with a preview of the order when the claim's return is applied.
* x-schemaName: AdminClaimReturnPreviewResponse * x-schemaName: AdminClaimReturnPreviewResponse
* required: * required:
* - order_preview * - order_preview
@@ -1,7 +1,7 @@
/** /**
* @schema AdminCollection * @schema AdminCollection
* type: object * type: object
* description: The parent's collection. * description: The product collection's details.
* x-schemaName: AdminCollection * x-schemaName: AdminCollection
* required: * required:
* - id * - id
@@ -28,17 +28,17 @@
* type: string * type: string
* format: date-time * format: date-time
* title: created_at * title: created_at
* description: The collection's created at. * description: The collection's creation date.
* updated_at: * updated_at:
* type: string * type: string
* format: date-time * format: date-time
* title: updated_at * title: updated_at
* description: The collection's updated at. * description: The collection's update date.
* deleted_at: * deleted_at:
* type: string * type: string
* format: date-time * format: date-time
* title: deleted_at * title: deleted_at
* description: The collection's deleted at. * description: The collection's deletion date.
* products: * products:
* type: array * type: array
* description: The collection's products. * description: The collection's products.
@@ -46,7 +46,7 @@
* $ref: "#/components/schemas/AdminProduct" * $ref: "#/components/schemas/AdminProduct"
* metadata: * metadata:
* type: object * type: object
* description: The collection's metadata. * description: The collection's metadata, used to store custom key-value pairs.
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminCollectionDeleteResponse * @schema AdminCollectionDeleteResponse
* type: object * type: object
* description: SUMMARY * description: The details of the deleted collection.
* x-schemaName: AdminCollectionDeleteResponse * x-schemaName: AdminCollectionDeleteResponse
* required: * required:
* - id * - id
@@ -20,7 +20,7 @@
* deleted: * deleted:
* type: boolean * type: boolean
* title: deleted * title: deleted
* description: Whether the Collection was deleted. * description: Whether the collection was deleted.
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminCollectionListResponse * @schema AdminCollectionListResponse
* type: object * type: object
* description: SUMMARY * description: The paginated list of product collections.
* x-schemaName: AdminCollectionListResponse * x-schemaName: AdminCollectionListResponse
* required: * required:
* - limit * - limit
@@ -12,18 +12,18 @@
* limit: * limit:
* type: number * type: number
* title: limit * title: limit
* description: The collection's limit. * description: The maximum number of items returned.
* offset: * offset:
* type: number * type: number
* title: offset * title: offset
* description: The collection's offset. * description: The number of items skipped before retrieving the returned results.
* count: * count:
* type: number * type: number
* title: count * title: count
* description: The collection's count. * description: The total number of items.
* collections: * collections:
* type: array * type: array
* description: The collection's collections. * description: The list of product collections.
* items: * items:
* $ref: "#/components/schemas/AdminCollection" * $ref: "#/components/schemas/AdminCollection"
* *