chore(oas): [10/n] improve oas schemas (#9167)

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

* fix validation error

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Shahed NasserandOli Juhl authored and GitHub committed 2024-09-19 18:51:55 +02:00
1 parent 230a16ac5c
commit d6ce0688db
17 files changed
+95 -92

No files matched your search

@@ -1,7 +1,7 @@
/** /**
* @schema AdminProductOption * @schema AdminProductOption
* type: object * type: object
* description: The product's product option. * description: The product option's details.
* x-schemaName: AdminProductOption * x-schemaName: AdminProductOption
* required: * required:
* - id * - id
@@ -20,7 +20,7 @@
* product_id: * product_id:
* type: string * type: string
* title: product_id * title: product_id
* description: The product option's product id. * description: The ID of the product this option belongs to.
* values: * values:
* type: array * type: array
* description: The product option's values. * description: The product option's values.
@@ -28,22 +28,22 @@
* $ref: "#/components/schemas/BaseProductOptionValue" * $ref: "#/components/schemas/BaseProductOptionValue"
* metadata: * metadata:
* type: object * type: object
* description: The product option's metadata. * description: The product option's metadata, can hold 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 product option's created at. * description: The date the product option was created.
* updated_at: * updated_at:
* type: string * type: string
* format: date-time * format: date-time
* title: updated_at * title: updated_at
* description: The product option's updated at. * description: The date the product option was updated.
* deleted_at: * deleted_at:
* type: string * type: string
* format: date-time * format: date-time
* title: deleted_at * title: deleted_at
* description: The product option's deleted at. * description: The date the product option was deleted.
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminProductOptionDeleteResponse * @schema AdminProductOptionDeleteResponse
* type: object * type: object
* description: SUMMARY * description: The details of the product option deletion.
* x-schemaName: AdminProductOptionDeleteResponse * x-schemaName: AdminProductOptionDeleteResponse
* required: * required:
* - id * - id
@@ -11,15 +11,16 @@
* id: * id:
* type: string * type: string
* title: id * title: id
* description: The product's ID. * description: The product option's ID.
* object: * object:
* type: string * type: string
* title: object * title: object
* description: The name of the deleted object. * description: The name of the deleted object.
* default: "product_option"
* deleted: * deleted:
* type: boolean * type: boolean
* title: deleted * title: deleted
* description: Whether the Product was deleted. * description: Whether the product option was deleted.
* parent: * parent:
* $ref: "#/components/schemas/AdminProduct" * $ref: "#/components/schemas/AdminProduct"
* *
@@ -1,7 +1,7 @@
/** /**
* @schema AdminProductOptionResponse * @schema AdminProductOptionResponse
* type: object * type: object
* description: SUMMARY * description: The product option's details.
* x-schemaName: AdminProductOptionResponse * x-schemaName: AdminProductOptionResponse
* required: * required:
* - product_option * - product_option
@@ -1,7 +1,7 @@
/** /**
* @schema AdminProductResponse * @schema AdminProductResponse
* type: object * type: object
* description: SUMMARY * description: The product's details.
* x-schemaName: AdminProductResponse * x-schemaName: AdminProductResponse
* required: * required:
* - product * - product
@@ -1,7 +1,7 @@
/** /**
* @schema AdminProductTag * @schema AdminProductTag
* type: object * type: object
* description: The tag's tags. * description: The product tag's details.
* x-schemaName: AdminProductTag * x-schemaName: AdminProductTag
* required: * required:
* - id * - id
@@ -21,20 +21,20 @@
* type: string * type: string
* format: date-time * format: date-time
* title: created_at * title: created_at
* description: The tag's created at. * description: The date the tag was created.
* updated_at: * updated_at:
* type: string * type: string
* format: date-time * format: date-time
* title: updated_at * title: updated_at
* description: The tag's updated at. * description: The date the tag was updated.
* deleted_at: * deleted_at:
* type: string * type: string
* format: date-time * format: date-time
* title: deleted_at * title: deleted_at
* description: The tag's deleted at. * description: The date the tag was deleted.
* metadata: * metadata:
* type: object * type: object
* description: The tag's metadata. * description: The tag's metadata, can hold custom key-value pairs.
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminProductTagDeleteResponse * @schema AdminProductTagDeleteResponse
* type: object * type: object
* description: SUMMARY * description: The details of the product tag deletion.
* x-schemaName: AdminProductTagDeleteResponse * x-schemaName: AdminProductTagDeleteResponse
* required: * required:
* - id * - id
@@ -20,7 +20,7 @@
* deleted: * deleted:
* type: boolean * type: boolean
* title: deleted * title: deleted
* description: Whether the Product Tag was deleted. * description: Whether the product tag was deleted.
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminProductTagListResponse * @schema AdminProductTagListResponse
* type: object * type: object
* description: SUMMARY * description: The paginated list of product tags.
* x-schemaName: AdminProductTagListResponse * x-schemaName: AdminProductTagListResponse
* required: * required:
* - limit * - limit
@@ -12,18 +12,18 @@
* limit: * limit:
* type: number * type: number
* title: limit * title: limit
* description: The product tag's limit. * description: The maximum number of items returned.
* offset: * offset:
* type: number * type: number
* title: offset * title: offset
* description: The product tag'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 product tag's count. * description: The total number of items.
* product_tags: * product_tags:
* type: array * type: array
* description: The product tag's product tags. * description: The list of product tags.
* items: * items:
* $ref: "#/components/schemas/AdminProductTag" * $ref: "#/components/schemas/AdminProductTag"
* *
@@ -1,7 +1,7 @@
/** /**
* @schema AdminProductTagResponse * @schema AdminProductTagResponse
* type: object * type: object
* description: SUMMARY * description: The product tag's details.
* x-schemaName: AdminProductTagResponse * x-schemaName: AdminProductTagResponse
* required: * required:
* - product_tag * - product_tag
@@ -1,7 +1,7 @@
/** /**
* @schema AdminProductType * @schema AdminProductType
* type: object * type: object
* description: The parent's type. * description: The product type's details.
* x-schemaName: AdminProductType * x-schemaName: AdminProductType
* required: * required:
* - id * - id
@@ -21,20 +21,20 @@
* type: string * type: string
* format: date-time * format: date-time
* title: created_at * title: created_at
* description: The type's created at. * description: The date the type was created.
* updated_at: * updated_at:
* type: string * type: string
* format: date-time * format: date-time
* title: updated_at * title: updated_at
* description: The type's updated at. * description: The date the type was updated.
* deleted_at: * deleted_at:
* type: string * type: string
* format: date-time * format: date-time
* title: deleted_at * title: deleted_at
* description: The type's deleted at. * description: The date the type was deleted.
* metadata: * metadata:
* type: object * type: object
* description: The type's metadata. * description: The type's metadata, can hold custom key-value pairs.
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminProductTypeDeleteResponse * @schema AdminProductTypeDeleteResponse
* type: object * type: object
* description: SUMMARY * description: The details of the product type deletion.
* x-schemaName: AdminProductTypeDeleteResponse * x-schemaName: AdminProductTypeDeleteResponse
* required: * required:
* - id * - id
@@ -20,7 +20,7 @@
* deleted: * deleted:
* type: boolean * type: boolean
* title: deleted * title: deleted
* description: Whether the Product Type was deleted. * description: Whether the product type was deleted.
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminProductTypeListResponse * @schema AdminProductTypeListResponse
* type: object * type: object
* description: SUMMARY * description: The paginated list of product types.
* x-schemaName: AdminProductTypeListResponse * x-schemaName: AdminProductTypeListResponse
* required: * required:
* - limit * - limit
@@ -12,18 +12,18 @@
* limit: * limit:
* type: number * type: number
* title: limit * title: limit
* description: The product type's limit. * description: The maximum number of items returned.
* offset: * offset:
* type: number * type: number
* title: offset * title: offset
* description: The product type'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 product type's count. * description: The total number of items.
* product_types: * product_types:
* type: array * type: array
* description: The product type's product types. * description: The list of product types.
* items: * items:
* $ref: "#/components/schemas/AdminProductType" * $ref: "#/components/schemas/AdminProductType"
* *
@@ -1,7 +1,7 @@
/** /**
* @schema AdminProductTypeResponse * @schema AdminProductTypeResponse
* type: object * type: object
* description: SUMMARY * description: The product type's details.
* x-schemaName: AdminProductTypeResponse * x-schemaName: AdminProductTypeResponse
* required: * required:
* - product_type * - product_type
@@ -1,7 +1,7 @@
/** /**
* @schema AdminProductVariant * @schema AdminProductVariant
* type: object * type: object
* description: The product's parent. * description: The product variant's details.
* x-schemaName: AdminProductVariant * x-schemaName: AdminProductVariant
* required: * required:
* - prices * - prices
@@ -28,84 +28,84 @@
* properties: * properties:
* prices: * prices:
* type: array * type: array
* description: The parent's prices. * description: The variant's prices.
* items: * items:
* $ref: "#/components/schemas/AdminPrice" * $ref: "#/components/schemas/AdminPrice"
* id: * id:
* type: string * type: string
* title: id * title: id
* description: The parent's ID. * description: The variant's ID.
* title: * title:
* type: string * type: string
* title: title * title: title
* description: The parent's title. * description: The variant's title.
* sku: * sku:
* type: string * type: string
* title: sku * title: sku
* description: The parent's sku. * description: The variant's SKU.
* barcode: * barcode:
* type: string * type: string
* title: barcode * title: barcode
* description: The parent's barcode. * description: The variant's barcode.
* ean: * ean:
* type: string * type: string
* title: ean * title: ean
* description: The parent's ean. * description: The variant's EAN code.
* upc: * upc:
* type: string * type: string
* title: upc * title: upc
* description: The parent's upc. * description: The variant's UPC.
* allow_backorder: * allow_backorder:
* type: boolean * type: boolean
* title: allow_backorder * title: allow_backorder
* description: The parent's allow backorder. * description: Whether the variant can be ordered even if it's out of stock.
* manage_inventory: * manage_inventory:
* type: boolean * type: boolean
* title: manage_inventory * title: manage_inventory
* description: The parent's manage inventory. * description: Whether the Medusa application manages the variant's inventory quantity and availablility. If disabled, the variant is always considered in stock.
* inventory_quantity: * inventory_quantity:
* type: number * type: number
* title: inventory_quantity * title: inventory_quantity
* description: The parent's inventory quantity. * description: The variant's inventory quantity. This is only included if you pass in the `fields` query parameter a `+variants.inventory_quantity` parameter.
* hs_code: * hs_code:
* type: string * type: string
* title: hs_code * title: hs_code
* description: The parent's hs code. * description: The variant's HS code.
* origin_country: * origin_country:
* type: string * type: string
* title: origin_country * title: origin_country
* description: The parent's origin country. * description: The variant's origin country.
* mid_code: * mid_code:
* type: string * type: string
* title: mid_code * title: mid_code
* description: The parent's mid code. * description: The variant's MID code.
* material: * material:
* type: string * type: string
* title: material * title: material
* description: The parent's material. * description: The variant's material.
* weight: * weight:
* type: number * type: number
* title: weight * title: weight
* description: The parent's weight. * description: The variant's weight.
* length: * length:
* type: number * type: number
* title: length * title: length
* description: The parent's length. * description: The variant's length.
* height: * height:
* type: number * type: number
* title: height * title: height
* description: The parent's height. * description: The variant's height.
* width: * width:
* type: number * type: number
* title: width * title: width
* description: The parent's width. * description: The variant's width.
* variant_rank: * variant_rank:
* type: number * type: number
* title: variant_rank * title: variant_rank
* description: The parent's variant rank. * description: The variant's rank among its sibling variants.
* options: * options:
* type: array * type: array
* description: The parent's options. * description: The variant's option values.
* items: * items:
* $ref: "#/components/schemas/BaseProductOptionValue" * $ref: "#/components/schemas/BaseProductOptionValue"
* product: * product:
@@ -113,27 +113,27 @@
* product_id: * product_id:
* type: string * type: string
* title: product_id * title: product_id
* description: The parent's product id. * description: The ID of the product that the variant belongs to.
* calculated_price: * calculated_price:
* $ref: "#/components/schemas/BaseCalculatedPriceSet" * $ref: "#/components/schemas/BaseCalculatedPriceSet"
* created_at: * created_at:
* type: string * type: string
* format: date-time * format: date-time
* title: created_at * title: created_at
* description: The parent's created at. * description: The date the variant was created.
* updated_at: * updated_at:
* type: string * type: string
* format: date-time * format: date-time
* title: updated_at * title: updated_at
* description: The parent's updated at. * description: The date the variant was updated.
* deleted_at: * deleted_at:
* type: string * type: string
* format: date-time * format: date-time
* title: deleted_at * title: deleted_at
* description: The parent's deleted at. * description: The date the variant was deleted.
* metadata: * metadata:
* type: object * type: object
* description: The parent's metadata. * description: The variant's metadata, can hold custom key-value pairs.
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminProductVariantDeleteResponse * @schema AdminProductVariantDeleteResponse
* type: object * type: object
* description: SUMMARY * description: The details of the product variant's deletion.
* x-schemaName: AdminProductVariantDeleteResponse * x-schemaName: AdminProductVariantDeleteResponse
* required: * required:
* - id * - id
@@ -11,7 +11,7 @@
* id: * id:
* type: string * type: string
* title: id * title: id
* description: The product's ID. * description: The product variant's ID.
* object: * object:
* type: string * type: string
* title: object * title: object
@@ -19,7 +19,8 @@
* deleted: * deleted:
* type: boolean * type: boolean
* title: deleted * title: deleted
* description: Whether the Product was deleted. * description: Whether the product variant was deleted.
* default: "variant"
* parent: * parent:
* $ref: "#/components/schemas/AdminProduct" * $ref: "#/components/schemas/AdminProduct"
* *
@@ -1,7 +1,7 @@
/** /**
* @schema AdminProductVariantInventoryBatchResponse * @schema AdminProductVariantInventoryBatchResponse
* type: object * type: object
* description: SUMMARY * description: The created, updated, and deleted associations between variants and inventory items.
* x-schemaName: AdminProductVariantInventoryBatchResponse * x-schemaName: AdminProductVariantInventoryBatchResponse
* required: * required:
* - created * - created
@@ -12,10 +12,10 @@
* oneOf: * oneOf:
* - $ref: "#/components/schemas/AdminProductVariantInventoryLink" * - $ref: "#/components/schemas/AdminProductVariantInventoryLink"
* - type: array * - type: array
* description: The product's created. * description: The created associations between product variants and inventory items.
* items: * items:
* type: object * type: object
* description: The created's details. * description: A created association between a product variant and an inventory item.
* x-schemaName: AdminProductVariantInventoryLink * x-schemaName: AdminProductVariantInventoryLink
* required: * required:
* - productService * - productService
@@ -23,32 +23,32 @@
* properties: * properties:
* productService: * productService:
* type: object * type: object
* description: The created's productservice. * description: The product variant's details.
* required: * required:
* - variant_id * - variant_id
* properties: * properties:
* variant_id: * variant_id:
* type: string * type: string
* title: variant_id * title: variant_id
* description: The productservice's variant id. * description: The ID of the product variant.
* inventoryService: * inventoryService:
* type: object * type: object
* description: The created's inventoryservice. * description: The inventory item's details.
* required: * required:
* - inventory_item_id * - inventory_item_id
* properties: * properties:
* inventory_item_id: * inventory_item_id:
* type: string * type: string
* title: inventory_item_id * title: inventory_item_id
* description: The inventoryservice's inventory item id. * description: The ID of the inventory item.
* updated: * updated:
* oneOf: * oneOf:
* - $ref: "#/components/schemas/AdminProductVariantInventoryLink" * - $ref: "#/components/schemas/AdminProductVariantInventoryLink"
* - type: array * - type: array
* description: The product's updated. * description: The updated associations between product variants and inventory items.
* items: * items:
* type: object * type: object
* description: The updated's details. * description: An updated association between a product variant and an inventory item.
* x-schemaName: AdminProductVariantInventoryLink * x-schemaName: AdminProductVariantInventoryLink
* required: * required:
* - productService * - productService
@@ -56,32 +56,32 @@
* properties: * properties:
* productService: * productService:
* type: object * type: object
* description: The updated's productservice. * description: The product variant's details.
* required: * required:
* - variant_id * - variant_id
* properties: * properties:
* variant_id: * variant_id:
* type: string * type: string
* title: variant_id * title: variant_id
* description: The productservice's variant id. * description: The ID of the product variant.
* inventoryService: * inventoryService:
* type: object * type: object
* description: The updated's inventoryservice. * description: The inventory item's details.
* required: * required:
* - inventory_item_id * - inventory_item_id
* properties: * properties:
* inventory_item_id: * inventory_item_id:
* type: string * type: string
* title: inventory_item_id * title: inventory_item_id
* description: The inventoryservice's inventory item id. * description: The ID of the inventory item.
* deleted: * deleted:
* oneOf: * oneOf:
* - $ref: "#/components/schemas/AdminProductVariantInventoryLink" * - $ref: "#/components/schemas/AdminProductVariantInventoryLink"
* - type: array * - type: array
* description: SUMMARY * description: The deleted associations between product variants and inventory items.
* items: * items:
* type: object * type: object
* description: SUMMARY * description: An deleted association between a product variant and an inventory item.
* x-schemaName: AdminProductVariantInventoryLink * x-schemaName: AdminProductVariantInventoryLink
* required: * required:
* - productService * - productService
@@ -89,24 +89,24 @@
* properties: * properties:
* productService: * productService:
* type: object * type: object
* description: The deleted's productservice. * description: The product variant's details.
* required: * required:
* - variant_id * - variant_id
* properties: * properties:
* variant_id: * variant_id:
* type: string * type: string
* title: variant_id * title: variant_id
* description: The productservice's variant id. * description: The ID of the product variant.
* inventoryService: * inventoryService:
* type: object * type: object
* description: The deleted's inventoryservice. * description: The inventory item's details.
* required: * required:
* - inventory_item_id * - inventory_item_id
* properties: * properties:
* inventory_item_id: * inventory_item_id:
* type: string * type: string
* title: inventory_item_id * title: inventory_item_id
* description: The inventoryservice's inventory item id. * description: The ID of the inventory item.
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminProductVariantInventoryLink * @schema AdminProductVariantInventoryLink
* type: object * type: object
* description: The product's ID. * description: The details of an association between a product variant and an inventory item.
* x-schemaName: AdminProductVariantInventoryLink * x-schemaName: AdminProductVariantInventoryLink
* required: * required:
* - productService * - productService
@@ -9,24 +9,24 @@
* properties: * properties:
* productService: * productService:
* type: object * type: object
* description: The id's productservice. * description: The product variant's details.
* required: * required:
* - variant_id * - variant_id
* properties: * properties:
* variant_id: * variant_id:
* type: string * type: string
* title: variant_id * title: variant_id
* description: The productservice's variant id. * description: The ID of the product variant.
* inventoryService: * inventoryService:
* type: object * type: object
* description: The id's inventoryservice. * description: The inventory item's details.
* required: * required:
* - inventory_item_id * - inventory_item_id
* properties: * properties:
* inventory_item_id: * inventory_item_id:
* type: string * type: string
* title: inventory_item_id * title: inventory_item_id
* description: The inventoryservice's inventory item id. * description: The ID of the inventory item.
* *
*/ */
@@ -1,7 +1,7 @@
/** /**
* @schema AdminProductVariantInventoryLinkDeleteResponse * @schema AdminProductVariantInventoryLinkDeleteResponse
* type: object * type: object
* description: SUMMARY * description: The details of the deleted associated between a product variant and an inventory item.
* x-schemaName: AdminProductVariantInventoryLinkDeleteResponse * x-schemaName: AdminProductVariantInventoryLinkDeleteResponse
* required: * required:
* - id * - id
@@ -15,10 +15,11 @@
* type: string * type: string
* title: object * title: object
* description: The name of the deleted object. * description: The name of the deleted object.
* default: "variant-inventory-item-link"
* deleted: * deleted:
* type: boolean * type: boolean
* title: deleted * title: deleted
* description: Whether the Product was deleted. * description: Whether the association was deleted.
* parent: * parent:
* $ref: "#/components/schemas/AdminProductVariant" * $ref: "#/components/schemas/AdminProductVariant"
* *