chore(oas): [9/n] improve oas schemas (#9166)

This commit is contained in:
Shahed Nasser
2024-09-17 20:27:28 +03:00
committed by GitHub
parent b5ffed6973
commit d2c48228df
20 changed files with 119 additions and 114 deletions

View File

@@ -1,20 +1,20 @@
/**
* @schema AdminPostReturnsReturnReqSchema
* type: object
* description: SUMMARY
* description: The return's details.
* x-schemaName: AdminPostReturnsReturnReqSchema
* properties:
* location_id:
* type: string
* title: location_id
* description: The return's location id.
* description: The ID of the location to return items to.
* no_notification:
* type: boolean
* title: no_notification
* description: The return's no notification.
* description: Whether the customer should receive notifications about updates to the return.
* metadata:
* type: object
* description: The return's metadata.
* description: The return's metadata, can hold custom key-value pairs.
*
*/

View File

@@ -1,20 +1,20 @@
/**
* @schema AdminPostReturnsShippingActionReqSchema
* type: object
* description: SUMMARY
* description: The shipping method's details.
* x-schemaName: AdminPostReturnsShippingActionReqSchema
* properties:
* custom_amount:
* type: number
* title: custom_amount
* description: The return's custom amount.
* description: Set a custom price for the shipping method.
* internal_note:
* type: string
* title: internal_note
* description: The return's internal note.
* description: A note viewed only by admin users.
* metadata:
* type: object
* description: The return's metadata.
* description: The return's metadata, can hold custom key-value pairs.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminPostReturnsShippingReqSchema
* type: object
* description: SUMMARY
* description: The shipping method's details.
* x-schemaName: AdminPostReturnsShippingReqSchema
* required:
* - shipping_option_id
@@ -9,22 +9,22 @@
* shipping_option_id:
* type: string
* title: shipping_option_id
* description: The exchange's shipping option id.
* description: The ID of the associated shipping option.
* custom_amount:
* type: number
* title: custom_amount
* description: The exchange's custom amount.
* description: Set the price of the shipping method.
* description:
* type: string
* title: description
* description: The exchange's description.
* description: The shipping method's description.
* internal_note:
* type: string
* title: internal_note
* description: The exchange's internal note.
* description: A note viewed only by admin users.
* metadata:
* type: object
* description: The exchange's metadata.
* description: The exchange's metadata, can hold custom key-value pairs.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminPrice
* type: object
* description: The price's prices.
* description: The price's details.
* x-schemaName: AdminPrice
* required:
* - id
@@ -28,6 +28,7 @@
* type: string
* title: currency_code
* description: The price's currency code.
* example: usd
* amount:
* type: number
* title: amount
@@ -38,30 +39,30 @@
* min_quantity:
* type: number
* title: min_quantity
* description: The price's min quantity.
* description: The minimum quantity that must be available in the cart for the price to be applied.
* max_quantity:
* type: number
* title: max_quantity
* description: The price's max quantity.
* description: The maximum quantity allowed to be available in the cart for the price to be applied.
* price_set_id:
* type: string
* title: price_set_id
* description: The price's price set id.
* description: The ID of the associated price set.
* created_at:
* type: string
* format: date-time
* title: created_at
* description: The price's created at.
* description: The date the price was created.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The price's updated at.
* description: The date the price was updated.
* deleted_at:
* type: string
* format: date-time
* title: deleted_at
* description: The price's deleted at.
* description: The date the price was deleted.
*
*/

View File

@@ -35,11 +35,11 @@
* starts_at:
* type: string
* title: starts_at
* description: The price list's starts at.
* description: The date the price list starts.
* ends_at:
* type: string
* title: ends_at
* description: The price list's ends at.
* description: The date the price list ends.
* status:
* type: string
* description: The price list's status.
@@ -61,17 +61,17 @@
* type: string
* format: date-time
* title: created_at
* description: The price list's created at.
* description: The date the price list was created.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The price list's updated at.
* description: The date the price list was updated.
* deleted_at:
* type: string
* format: date-time
* title: deleted_at
* description: The price list's deleted at.
* description: The date the price list was deleted.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminPriceListBatchResponse
* type: object
* description: SUMMARY
* description: The details of the created, updated, and deleted prices in a price list.
* x-schemaName: AdminPriceListBatchResponse
* required:
* - created
@@ -10,17 +10,17 @@
* properties:
* created:
* type: array
* description: The price list's created.
* description: The created prices.
* items:
* $ref: "#/components/schemas/AdminPrice"
* updated:
* type: array
* description: The price list's updated.
* description: The updated prices.
* items:
* $ref: "#/components/schemas/AdminPrice"
* deleted:
* type: object
* description: SUMMARY
* description: The details of the deleted prices.
* required:
* - ids
* - object
@@ -28,19 +28,20 @@
* properties:
* ids:
* type: array
* description: The deleted's ids.
* description: The IDs of the deleted prices.
* items:
* type: string
* title: ids
* description: The id's ids.
* description: A price's ID.
* object:
* type: string
* title: object
* description: SUMMARY
* description: The name of the deleted object.
* default: "price"
* deleted:
* type: boolean
* title: deleted
* description: SUMMARY
* description: Whether the prices were deleted.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminPriceListDeleteResponse
* type: object
* description: SUMMARY
* description: The details of the deleted price list.
* x-schemaName: AdminPriceListDeleteResponse
* required:
* - id
@@ -20,7 +20,7 @@
* deleted:
* type: boolean
* title: deleted
* description: Whether the Price List was deleted.
* description: Whether the price list was deleted.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminPriceListListResponse
* type: object
* description: SUMMARY
* description: The paginated list of price lists.
* x-schemaName: AdminPriceListListResponse
* required:
* - limit
@@ -12,18 +12,18 @@
* limit:
* type: number
* title: limit
* description: The price list's limit.
* description: The maximum number of items returned.
* offset:
* type: number
* title: offset
* description: The price list's offset.
* description: The number of items skipped before retrieving the returned items.
* count:
* type: number
* title: count
* description: The price list's count.
* description: The total number of items.
* price_lists:
* type: array
* description: The price list's price lists.
* description: The list of price lists.
* items:
* $ref: "#/components/schemas/AdminPriceList"
*

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminPriceListPrice
* type: object
* description: The price's prices.
* description: The details of a price list's price.
* x-schemaName: AdminPriceListPrice
* required:
* - variant_id
@@ -21,7 +21,7 @@
* variant_id:
* type: string
* title: variant_id
* description: The price's variant id.
* description: The ID of the product variant this price list is for.
* rules:
* type: object
* description: The price's rules.
@@ -37,6 +37,7 @@
* type: string
* title: currency_code
* description: The price's currency code.
* example: usd
* amount:
* type: number
* title: amount
@@ -47,30 +48,30 @@
* min_quantity:
* type: number
* title: min_quantity
* description: The price's min quantity.
* description: The minimum quantity that must be available in the cart for the price to be applied.
* max_quantity:
* type: number
* title: max_quantity
* description: The price's max quantity.
* description: The maximum quantity allowed to be available in the cart for the price to be applied.
* price_set_id:
* type: string
* title: price_set_id
* description: The price's price set id.
* description: The ID of the price set this price belongs to.
* created_at:
* type: string
* format: date-time
* title: created_at
* description: The price's created at.
* description: The date the price was created.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The price's updated at.
* description: The date the price was updated.
* deleted_at:
* type: string
* format: date-time
* title: deleted_at
* description: The price's deleted at.
* description: The date the price was deleted.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminPriceListResponse
* type: object
* description: SUMMARY
* description: The price list's details.
* x-schemaName: AdminPriceListResponse
* required:
* - price_list

View File

@@ -20,29 +20,31 @@
* type: string
* title: attribute
* description: The price preference's attribute.
* example: region_id
* value:
* type: string
* title: value
* description: The price preference's value.
* example: reg_123
* is_tax_inclusive:
* type: boolean
* title: is_tax_inclusive
* description: The price preference's is tax inclusive.
* description: Whether prices matching this preference include taxes.
* created_at:
* type: string
* format: date-time
* title: created_at
* description: The price preference's created at.
* description: The date the price preference was created.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The price preference's updated at.
* description: The date the price preference was updated.
* deleted_at:
* type: string
* format: date-time
* title: deleted_at
* description: The price preference's deleted at.
* description: The date the price preference was deleted.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminPricePreferenceDeleteResponse
* type: object
* description: SUMMARY
* description: The details of the deleted price preference.
* x-schemaName: AdminPricePreferenceDeleteResponse
* required:
* - id
@@ -20,7 +20,7 @@
* deleted:
* type: boolean
* title: deleted
* description: Whether the Price Preference was deleted.
* description: Whether the price preference was deleted.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminPricePreferenceListResponse
* type: object
* description: SUMMARY
* description: The paginated list of price preferences.
* x-schemaName: AdminPricePreferenceListResponse
* required:
* - limit
@@ -12,18 +12,18 @@
* limit:
* type: number
* title: limit
* description: The price preference's limit.
* description: The maximum number of items returned.
* offset:
* type: number
* title: offset
* description: The price preference's offset.
* description: The number of items skipped before retrieving the returned items.
* count:
* type: number
* title: count
* description: The price preference's count.
* description: The total count of items.
* price_preferences:
* type: array
* description: The price preference's price preferences.
* description: The list of price preferences.
* items:
* $ref: "#/components/schemas/AdminPricePreference"
*

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminPricePreferenceResponse
* type: object
* description: SUMMARY
* description: The price preference's details.
* x-schemaName: AdminPricePreferenceResponse
* required:
* - price_preference

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminProduct
* type: object
* description: The product's parent.
* description: The product's details.
* x-schemaName: AdminProduct
* required:
* - type
@@ -35,37 +35,37 @@
* $ref: "#/components/schemas/AdminCollection"
* categories:
* type: array
* description: The parent's categories.
* description: The product's categories.
* items:
* $ref: "#/components/schemas/AdminProductCategory"
* sales_channels:
* type: array
* description: The parent's sales channels.
* description: The sales channels that the product is available in.
* items:
* $ref: "#/components/schemas/AdminSalesChannel"
* variants:
* type: array
* description: The parent's variants.
* description: The product's variants.
* items:
* $ref: "#/components/schemas/AdminProductVariant"
* type:
* $ref: "#/components/schemas/AdminProductType"
* tags:
* type: array
* description: The parent's tags.
* description: The product's tags.
* items:
* $ref: "#/components/schemas/AdminProductTag"
* length:
* type: number
* title: length
* description: The parent's length.
* description: The product's length.
* title:
* type: string
* title: title
* description: The parent's title.
* description: The product's title.
* status:
* type: string
* description: The parent's status.
* description: The product's status.
* enum:
* - draft
* - proposed
@@ -73,100 +73,100 @@
* - rejected
* options:
* type: array
* description: The parent's options.
* description: The product's options.
* items:
* $ref: "#/components/schemas/BaseProductOption"
* description:
* type: string
* title: description
* description: The parent's description.
* description: The product's description.
* id:
* type: string
* title: id
* description: The parent's ID.
* description: The product's ID.
* metadata:
* type: object
* description: The parent's metadata.
* description: The product's metadata, can hold custom key-value pairs.
* created_at:
* type: string
* format: date-time
* title: created_at
* description: The parent's created at.
* description: The date the product was created.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The parent's updated at.
* description: The date the product was updated.
* handle:
* type: string
* title: handle
* description: The parent's handle.
* description: The product's unique handle.
* subtitle:
* type: string
* title: subtitle
* description: The parent's subtitle.
* description: The product's subtitle.
* is_giftcard:
* type: boolean
* title: is_giftcard
* description: The parent's is giftcard.
* description: Whether the product is a gift card.
* thumbnail:
* type: string
* title: thumbnail
* description: The parent's thumbnail.
* description: The product's thumbnail.
* width:
* type: number
* title: width
* description: The parent's width.
* description: The product's width.
* weight:
* type: number
* title: weight
* description: The parent's weight.
* description: The product's weight.
* height:
* type: number
* title: height
* description: The parent's height.
* description: The product's height.
* origin_country:
* type: string
* title: origin_country
* description: The parent's origin country.
* description: The product's origin country.
* hs_code:
* type: string
* title: hs_code
* description: The parent's hs code.
* description: The product's HS code.
* mid_code:
* type: string
* title: mid_code
* description: The parent's mid code.
* description: The product's MID code.
* material:
* type: string
* title: material
* description: The parent's material.
* description: The product's material.
* collection_id:
* type: string
* title: collection_id
* description: The parent's collection id.
* description: The ID of the collection that the product belongs to.
* type_id:
* type: string
* title: type_id
* description: The parent's type id.
* description: The ID of the product's type.
* images:
* type: array
* description: The parent's images.
* description: The product's images.
* items:
* $ref: "#/components/schemas/BaseProductImage"
* discountable:
* type: boolean
* title: discountable
* description: The parent's discountable.
* description: Whether discounts can be applied on the product.
* external_id:
* type: string
* title: external_id
* description: The parent's external id.
* description: The ID of a product in an external system, such as an ERP or CMS.
* deleted_at:
* type: string
* format: date-time
* title: deleted_at
* description: The parent's deleted at.
* description: The date the product was deleted.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminProductCategory
* type: object
* description: The category's categories.
* description: The product category's details.
* x-schemaName: AdminProductCategory
* required:
* - category_children
@@ -20,7 +20,7 @@
* properties:
* category_children:
* type: array
* description: The category's category children.
* description: The category's children.
* items:
* $ref: "#/components/schemas/AdminProductCategory"
* parent_category:
@@ -44,42 +44,42 @@
* description: The category's ID.
* metadata:
* type: object
* description: The category's metadata.
* description: The category's metadata, can hold custom key-value pairs.
* created_at:
* type: string
* format: date-time
* title: created_at
* description: The category's created at.
* description: The date the category was created.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The category's updated at.
* description: The date the category was updated.
* handle:
* type: string
* title: handle
* description: The category's handle.
* description: The category's unique handle.
* deleted_at:
* type: string
* format: date-time
* title: deleted_at
* description: The category's deleted at.
* description: The date the category was deleted.
* is_active:
* type: boolean
* title: is_active
* description: The category's is active.
* description: Whether the category is active. If disabled, the category isn't shown in the storefront.
* is_internal:
* type: boolean
* title: is_internal
* description: The category's is internal.
* description: Whether the category is internal. If enabled, the category is only seen by admin users.
* rank:
* type: number
* title: rank
* description: The category's rank.
* description: The category's rank among sibling categories.
* parent_category_id:
* type: string
* title: parent_category_id
* description: The category's parent category id.
* description: The ID of the category's parent.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminProductCategoryDeleteResponse
* type: object
* description: SUMMARY
* description: The details of deleting the category.
* x-schemaName: AdminProductCategoryDeleteResponse
* required:
* - id
@@ -20,7 +20,7 @@
* deleted:
* type: boolean
* title: deleted
* description: Whether the Product Category was deleted.
* description: Whether the product category was deleted.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminProductCategoryListResponse
* type: object
* description: SUMMARY
* description: The paginated list of product categories.
* x-schemaName: AdminProductCategoryListResponse
* required:
* - limit
@@ -12,18 +12,18 @@
* limit:
* type: number
* title: limit
* description: The product category's limit.
* description: The maximum number of items returned.
* offset:
* type: number
* title: offset
* description: The product category's offset.
* description: The number of items skipped before retrieving the returned items.
* count:
* type: number
* title: count
* description: The product category's count.
* description: The total number of items.
* product_categories:
* type: array
* description: The product category's product categories.
* description: The list of product categories.
* items:
* $ref: "#/components/schemas/AdminProductCategory"
*

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminProductCategoryResponse
* type: object
* description: SUMMARY
* description: The product category's details.
* x-schemaName: AdminProductCategoryResponse
* required:
* - product_category

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminProductDeleteResponse
* type: object
* description: SUMMARY
* description: The details of the product deletion.
* x-schemaName: AdminProductDeleteResponse
* required:
* - id
@@ -20,7 +20,7 @@
* deleted:
* type: boolean
* title: deleted
* description: Whether the Product was deleted.
* description: Whether the product was deleted.
*
*/