chore(oas): [14/n] improve OAS schemas (#9202)

* chore(oas): [14/n] improve OAS schemas

* fix description of required_quantity
This commit is contained in:
Shahed Nasser
2024-09-19 19:52:46 +03:00
committed by GitHub
parent d6ce0688db
commit 426c39c04b
20 changed files with 133 additions and 281 deletions

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminUpdateApiKey
* type: object
* description: SUMMARY
* description: The details to update in an API key.
* x-schemaName: AdminUpdateApiKey
* required:
* - title
@@ -9,7 +9,7 @@
* title:
* type: string
* title: title
* description: The api key's title.
* description: The API key's title.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminUpdateCollection
* type: object
* description: SUMMARY
* description: The details to update in a collection.
* x-schemaName: AdminUpdateCollection
* properties:
* title:
@@ -14,7 +14,7 @@
* description: The collection's handle.
* metadata:
* type: object
* description: The collection's metadata.
* description: The collection's metadata, can hold custom key-value pairs.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminUpdateCustomerGroup
* type: object
* description: SUMMARY
* description: The details to update in a customer group.
* x-schemaName: AdminUpdateCustomerGroup
* properties:
* name:
@@ -10,7 +10,7 @@
* description: The customer group's name.
* metadata:
* type: object
* description: The customer group's metadata.
* description: The customer group's metadata, can hold custom key-value pairs.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminUpdatePriceList
* type: object
* description: SUMMARY
* description: the details to update in a price list.
* x-schemaName: AdminUpdatePriceList
* properties:
* title:
@@ -15,11 +15,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.
@@ -35,6 +35,8 @@
* rules:
* type: object
* description: The price list's rules.
*
* example:
* customer_group_id:
* - "cusgrp_123"
*/

View File

@@ -1,21 +1,23 @@
/**
* @schema AdminUpdatePricePreference
* type: object
* description: SUMMARY
* description: The details to update in the price preference.
* x-schemaName: AdminUpdatePricePreference
* properties:
* attribute:
* 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 are tax inclusive for this price preference.
*
*/

View File

@@ -1,53 +1,53 @@
/**
* @schema AdminUpdateProduct
* type: object
* description: The update's details.
* description: The product's details.
* x-schemaName: AdminUpdateProduct
* properties:
* title:
* type: string
* title: title
* description: The update's title.
* description: The product's title.
* subtitle:
* type: string
* title: subtitle
* description: The update's subtitle.
* description: The product's subtitle.
* description:
* type: string
* title: description
* description: The update's description.
* description: The product's description.
* is_giftcard:
* type: boolean
* title: is_giftcard
* description: The update's is giftcard.
* description: Whether the product is a gift card.
* discountable:
* type: boolean
* title: discountable
* description: The update's discountable.
* description: Whether discounts can be applied on the product.
* images:
* type: array
* description: The update's images.
* description: The product's images.
* items:
* type: object
* description: The image's images.
* description: The image's details.
* required:
* - url
* properties:
* url:
* type: string
* title: url
* description: The image's url.
* description: The image's URL.
* thumbnail:
* type: string
* title: thumbnail
* description: The update's thumbnail.
* description: The product's thumbnail URL.
* handle:
* type: string
* title: handle
* description: The update's handle.
* description: The product's unique handle.
* status:
* type: string
* description: The update's status.
* description: The product's status.
* enum:
* - draft
* - proposed
@@ -56,17 +56,17 @@
* type_id:
* type: string
* title: type_id
* description: The update's type id.
* description: The ID of the product's type.
* collection_id:
* type: string
* title: collection_id
* description: The update's collection id.
* description: The ID of the product's collection.
* categories:
* type: array
* description: The update's categories.
* description: The product's categories.
* items:
* type: object
* description: The category's categories.
* description: The product's category.
* required:
* - id
* properties:
@@ -76,10 +76,10 @@
* description: The category's ID.
* tags:
* type: array
* description: The update's tags.
* description: The product's tags.
* items:
* type: object
* description: The tag's tags.
* description: The product's tag.
* required:
* - id
* properties:
@@ -89,181 +89,22 @@
* description: The tag's ID.
* options:
* type: array
* description: The update's options.
* description: The product's options.
* items:
* $ref: "#/components/schemas/AdminUpdateProductOption"
* variants:
* type: array
* description: The update's variants.
* description: The product's variants. You can add new variants or update existing ones, passing their IDs in the object.
* items:
* oneOf:
* - type: object
* description: The variant's variants.
* x-schemaName: AdminCreateProductVariant
* required:
* - title
* - prices
* properties:
* title:
* type: string
* title: title
* description: The variant's title.
* sku:
* type: string
* title: sku
* description: The variant's sku.
* ean:
* type: string
* title: ean
* description: The variant's ean.
* upc:
* type: string
* title: upc
* description: The variant's upc.
* barcode:
* type: string
* title: barcode
* description: The variant's barcode.
* hs_code:
* type: string
* title: hs_code
* description: The variant's hs code.
* mid_code:
* type: string
* title: mid_code
* description: The variant's mid code.
* allow_backorder:
* type: boolean
* title: allow_backorder
* description: The variant's allow backorder.
* manage_inventory:
* type: boolean
* title: manage_inventory
* description: The variant's manage inventory.
* variant_rank:
* type: number
* title: variant_rank
* description: The variant's variant rank.
* weight:
* type: number
* title: weight
* description: The variant's weight.
* length:
* type: number
* title: length
* description: The variant's length.
* height:
* type: number
* title: height
* description: The variant's height.
* width:
* type: number
* title: width
* description: The variant's width.
* origin_country:
* type: string
* title: origin_country
* description: The variant's origin country.
* material:
* type: string
* title: material
* description: The variant's material.
* metadata:
* type: object
* description: The variant's metadata.
* prices:
* type: array
* description: The variant's prices.
* items:
* $ref: "#/components/schemas/AdminCreateProductVariantPrice"
* options:
* type: object
* description: The variant's options.
* - type: object
* description: The variant's variants.
* x-schemaName: AdminUpdateProductVariant
* properties:
* title:
* type: string
* title: title
* description: The variant's title.
* sku:
* type: string
* title: sku
* description: The variant's sku.
* ean:
* type: string
* title: ean
* description: The variant's ean.
* upc:
* type: string
* title: upc
* description: The variant's upc.
* barcode:
* type: string
* title: barcode
* description: The variant's barcode.
* hs_code:
* type: string
* title: hs_code
* description: The variant's hs code.
* mid_code:
* type: string
* title: mid_code
* description: The variant's mid code.
* allow_backorder:
* type: boolean
* title: allow_backorder
* description: The variant's allow backorder.
* manage_inventory:
* type: boolean
* title: manage_inventory
* description: The variant's manage inventory.
* variant_rank:
* type: number
* title: variant_rank
* description: The variant's variant rank.
* weight:
* type: number
* title: weight
* description: The variant's weight.
* length:
* type: number
* title: length
* description: The variant's length.
* height:
* type: number
* title: height
* description: The variant's height.
* width:
* type: number
* title: width
* description: The variant's width.
* origin_country:
* type: string
* title: origin_country
* description: The variant's origin country.
* material:
* type: string
* title: material
* description: The variant's material.
* metadata:
* type: object
* description: The variant's metadata.
* prices:
* type: array
* description: The variant's prices.
* items:
* $ref: "#/components/schemas/AdminCreateProductVariantPrice"
* options:
* type: object
* description: The variant's options.
* - $ref: "#/components/schemas/AdminCreateProductVariant"
* - $ref: "#/components/schemas/AdminUpdateProductVariant"
* sales_channels:
* type: array
* description: The update's sales channels.
* description: The sales channels that the product is available in.
* items:
* type: object
* description: The sales channel's sales channels.
* description: The sales channel's details.
* required:
* - id
* properties:
@@ -274,38 +115,38 @@
* weight:
* type: number
* title: weight
* description: The update's weight.
* description: The product's weight.
* length:
* type: number
* title: length
* description: The update's length.
* description: The product's length.
* height:
* type: number
* title: height
* description: The update's height.
* description: The product's height.
* width:
* type: number
* title: width
* description: The update's width.
* description: The product's width.
* hs_code:
* type: string
* title: hs_code
* description: The update's hs code.
* description: The product's HS code.
* mid_code:
* type: string
* title: mid_code
* description: The update's mid code.
* description: The product's MID code.
* origin_country:
* type: string
* title: origin_country
* description: The update's origin country.
* description: The product's origin country.
* material:
* type: string
* title: material
* description: The update's material.
* description: The product's material.
* metadata:
* type: object
* description: The update's metadata.
* description: The product's metadata, can hold custom key-value pairs.
*
*/

View File

@@ -1,20 +1,20 @@
/**
* @schema AdminUpdateProductOption
* type: object
* description: SUMMARY
* description: The details to update in a product option.
* x-schemaName: AdminUpdateProductOption
* properties:
* title:
* type: string
* title: title
* description: The product's title.
* description: The option's title.
* values:
* type: array
* description: The product's values.
* description: The option's values.
* items:
* type: string
* title: values
* description: The value's values.
* description: An option value.
*
*/

View File

@@ -1,84 +1,84 @@
/**
* @schema AdminUpdateProductVariant
* type: object
* description: The update's details.
* description: The properties to update of a product variant.
* x-schemaName: AdminUpdateProductVariant
* properties:
* title:
* type: string
* title: title
* description: The update's title.
* description: The product variant's title.
* sku:
* type: string
* title: sku
* description: The update's sku.
* description: The product variant's SKU.
* ean:
* type: string
* title: ean
* description: The update's ean.
* description: The product variant's EAN.
* upc:
* type: string
* title: upc
* description: The update's upc.
* description: The product variant's UPC.
* barcode:
* type: string
* title: barcode
* description: The update's barcode.
* description: The product variant's barcode.
* hs_code:
* type: string
* title: hs_code
* description: The update's hs code.
* description: The product variant's HS code.
* mid_code:
* type: string
* title: mid_code
* description: The update's mid code.
* description: The product variant's MID code.
* allow_backorder:
* type: boolean
* title: allow_backorder
* description: The update's allow backorder.
* description: Whether customers can order the variant even if it's not in stock.
* manage_inventory:
* type: boolean
* title: manage_inventory
* description: The update's manage inventory.
* description: Whether the Medusa application manages the variant's inventory. If disabled, the product variant is always considered in stock.
* variant_rank:
* type: number
* title: variant_rank
* description: The update's variant rank.
* description: The product variant's rank among its siblings.
* weight:
* type: number
* title: weight
* description: The update's weight.
* description: The product variant's weight.
* length:
* type: number
* title: length
* description: The update's length.
* description: The product variant's length.
* height:
* type: number
* title: height
* description: The update's height.
* description: The product variant's height.
* width:
* type: number
* title: width
* description: The update's width.
* description: The product variant's width.
* origin_country:
* type: string
* title: origin_country
* description: The update's origin country.
* description: The product variant's origin country.
* material:
* type: string
* title: material
* description: The update's material.
* description: The product variant's material.
* metadata:
* type: object
* description: The update's metadata.
* description: The product variant's metadata, can hold custom key-value pairs.
* prices:
* type: array
* description: The update's prices.
* description: The product variant's prices.
* items:
* $ref: "#/components/schemas/AdminCreateProductVariantPrice"
* options:
* type: object
* description: The update's options.
* description: The product variant's options.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminUpdateSalesChannel
* type: object
* description: SUMMARY
* description: The properties to update in the sales channel.
* x-schemaName: AdminUpdateSalesChannel
* properties:
* name:
@@ -15,10 +15,10 @@
* is_disabled:
* type: boolean
* title: is_disabled
* description: The sales channel's is disabled.
* description: Whether the sales channel is disabled.
* metadata:
* type: object
* description: The sales channel's metadata.
* description: The sales channel's metadata, can hold custom key-value pairs.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminUpdateStockLocation
* type: object
* description: SUMMARY
* description: The properties to update in a stock location.
* x-schemaName: AdminUpdateStockLocation
* properties:
* name:
@@ -10,7 +10,7 @@
* description: The stock location's name.
* address:
* type: object
* description: The stock location's address.
* description: The stock location's address. Pass this property if you're creating a new address to associate with the location.
* required:
* - address_1
* - country_code
@@ -18,11 +18,11 @@
* address_1:
* type: string
* title: address_1
* description: The address's address 1.
* description: The address's first line.
* address_2:
* type: string
* title: address_2
* description: The address's address 2.
* description: The address's second line.
* company:
* type: string
* title: company
@@ -35,6 +35,7 @@
* type: string
* title: country_code
* description: The address's country code.
* example: us
* phone:
* type: string
* title: phone
@@ -50,10 +51,10 @@
* address_id:
* type: string
* title: address_id
* description: The stock location's address id.
* description: The ID of an existing stock location address to associate the stock location with.
* metadata:
* type: object
* description: The stock location's metadata.
* description: The stock location's metadata, can hold custom key-value pairs.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminUpdateStore
* type: object
* description: SUMMARY
* description: The properties to update in a store.
* x-schemaName: AdminUpdateStore
* properties:
* name:
@@ -13,37 +13,38 @@
* description: The store's supported currencies.
* items:
* type: object
* description: The supported currency's supported currencies.
* description: A store currency.
* required:
* - currency_code
* properties:
* currency_code:
* type: string
* title: currency_code
* description: The supported currency's currency code.
* description: The currency's code.
* example: usd
* is_default:
* type: boolean
* title: is_default
* description: The supported currency's is default.
* description: Whether the currency is the default in the store.
* is_tax_inclusive:
* type: boolean
* title: is_tax_inclusive
* description: The supported currency's is tax inclusive.
* description: Whether prices using this currency are tax inclusive.
* default_sales_channel_id:
* type: string
* title: default_sales_channel_id
* description: The store's default sales channel id.
* description: The ID of the default sales channel in the store.
* default_region_id:
* type: string
* title: default_region_id
* description: The store's default region id.
* description: The ID of the default region in the store.
* default_location_id:
* type: string
* title: default_location_id
* description: The store's default location id.
* description: The ID of the default stock location in the store.
* metadata:
* type: object
* description: The store's metadata.
* description: The store's metadata, can hold custom key-value pairs.
*
*/

View File

@@ -1,23 +1,23 @@
/**
* @schema AdminUpdateTaxRate
* type: object
* description: SUMMARY
* description: The properties to update in the tax rate.
* x-schemaName: AdminUpdateTaxRate
* properties:
* rate:
* type: number
* title: rate
* description: The tax rate's rate.
* description: The rate to charge.
* code:
* type: string
* title: code
* description: The tax rate's code.
* description: The code that the tax rate is identified by.
* rules:
* type: array
* description: The tax rate's rules.
* items:
* type: object
* description: The rule's rules.
* description: A tax rate rule.
* required:
* - reference
* - reference_id
@@ -25,11 +25,13 @@
* reference:
* type: string
* title: reference
* description: The rule's reference.
* description: The name of the table this rule references.
* example: product_type
* reference_id:
* type: string
* title: reference_id
* description: The rule's reference id.
* description: The ID of the record in the table that the rule references.
* example: ptyp_123
* name:
* type: string
* title: name
@@ -37,14 +39,16 @@
* is_default:
* type: boolean
* title: is_default
* description: The tax rate's is default.
* description: Whether the tax rate is the default in the store.
* is_combinable:
* type: boolean
* title: is_combinable
* description: The tax rate's is combinable.
* description: Whether the tax rate should be combined with parent rates.
* externalDocs:
* url: https://docs.medusajs.com/v2/resources/commerce-modules/tax/tax-rates-and-rules#combinable-tax-rates
* metadata:
* type: object
* description: The tax rate's metadata.
* description: The tax rate's metadata, can hold custom key-value pairs.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminUpdateUser
* type: object
* description: SUMMARY
* description: The properties to update in a user.
* x-schemaName: AdminUpdateUser
* properties:
* first_name:
@@ -15,7 +15,7 @@
* avatar_url:
* type: string
* title: avatar_url
* description: The user's avatar url.
* description: The URL of the user's avatar.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminUpdateVariantInventoryItem
* type: object
* description: SUMMARY
* description: The properties to update of the variant's inventory item association.
* x-schemaName: AdminUpdateVariantInventoryItem
* required:
* - required_quantity
@@ -9,7 +9,7 @@
* required_quantity:
* type: number
* title: required_quantity
* description: The product's required quantity.
* description: The number of units a single quantity is equivalent to. For example, if a customer orders one quantity of the variant, Medusa checks the availability of the quantity multiplied by the value set for `required_quantity`. When the customer orders the quantity, Medusa reserves the ordered quantity multiplied by the value set for `required_quantity`.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminUpsertStockLocationAddress
* type: object
* description: The stock location's address.
* description: The details of the stock location address to create.
* x-schemaName: AdminUpsertStockLocationAddress
* required:
* - address_1
@@ -10,11 +10,11 @@
* address_1:
* type: string
* title: address_1
* description: The address's address 1.
* description: The address's first line.
* address_2:
* type: string
* title: address_2
* description: The address's address 2.
* description: The address's second line.
* company:
* type: string
* title: company
@@ -23,6 +23,7 @@
* type: string
* title: country_code
* description: The address's country code.
* example: usd
* city:
* type: string
* title: city

View File

@@ -34,25 +34,25 @@
* avatar_url:
* type: string
* title: avatar_url
* description: The user's avatar url.
* description: The URL of the user's avatar.
* metadata:
* type: object
* description: The user's metadata.
* description: The user's metadata, can hold custom key-value pairs.
* created_at:
* type: string
* format: date-time
* title: created_at
* description: The user's created at.
* description: The date the user was created.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The user's updated at.
* description: The date the user was updated.
* deleted_at:
* type: string
* format: date-time
* title: deleted_at
* description: The user's deleted at.
* description: The date the user was deleted.
*
*/

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminUserResponse
* type: object
* description: SUMMARY
* description: The user's details.
* x-schemaName: AdminUserResponse
* required:
* - user

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminWorkflowExecution
* type: object
* description: The workflows execution's workflow execution.
* description: The workflows execution's details.
* x-schemaName: AdminWorkflowExecution
* required:
* - id
@@ -20,11 +20,11 @@
* workflow_id:
* type: string
* title: workflow_id
* description: The workflow execution's workflow id.
* description: The ID of the workflow.
* transaction_id:
* type: string
* title: transaction_id
* description: The workflow execution's transaction id.
* description: The workflow execution's transaction ID.
* execution:
* $ref: "#/components/schemas/AdminWorkflowExecutionExecution"
* context:
@@ -44,17 +44,17 @@
* type: string
* format: date-time
* title: created_at
* description: The workflow execution's created at.
* description: The date the workflow execution was created.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The workflow execution's updated at.
* description: The date the workflow execution was updated.
* deleted_at:
* type: string
* format: date-time
* title: deleted_at
* description: The workflow execution's deleted at.
* description: The date the workflow execution was deleted.
*
*/