oas: [4/n] improve oas schemas (#9064)

Improve oas schemas [4/n]
This commit is contained in:
Shahed Nasser
2024-09-09 21:52:49 +03:00
committed by GitHub
parent dfb095e2ea
commit abb5f0c2fe
20 changed files with 143 additions and 143 deletions

View File

@@ -33,11 +33,6 @@
* - api_token: []
* - cookie_auth: []
* - jwt_token: []
* requestBody:
* content:
* application/json:
* schema:
* $ref: "#/components/schemas/AdminExportProductRequest"
* x-codeSamples:
* - lang: Shell
* label: cURL

View File

@@ -1,35 +1,35 @@
/**
* @schema AdminCustomerInGroupFilters
* type: object
* description: The customer group's customers.
* description: Filters to apply on customers to retrieve their groups.
* x-schemaName: AdminCustomerInGroupFilters
* properties:
* id:
* oneOf:
* - type: string
* title: id
* description: The customer's ID.
* description: Filter by a customer's ID.
* - type: array
* description: The customer's ID.
* description: Filter by customer IDs.
* items:
* type: string
* title: id
* description: The id's ID.
* description: A customer's ID.
* email:
* oneOf:
* - type: string
* title: email
* description: The customer's email.
* description: Filter by a customer's email.
* format: email
* - type: array
* description: The customer's email.
* description: Filter by customer emails.
* items:
* type: string
* title: email
* description: The email's details.
* description: A customer's email.
* format: email
* - type: object
* description: The customer's email.
* description: Apply filters on the customer's email.
* properties:
* $and:
* type: array
@@ -49,7 +49,7 @@
* title: $eq
* description: Filter by an exact match.
* - type: array
* description: Filter by an exact match.
* description: Filter by exact matches
* items:
* type: string
* title: $eq
@@ -146,71 +146,71 @@
* oneOf:
* - type: string
* title: default_billing_address_id
* description: The customer's default billing address id.
* description: Filter by the ID of a customer's default billing address.
* - type: array
* description: The customer's default billing address id.
* description: Filter by the IDs of a customers' default billing address.
* items:
* type: string
* title: default_billing_address_id
* description: The default billing address id's details.
* description: The ID of a customer's default billing address.
* default_shipping_address_id:
* oneOf:
* - type: string
* title: default_shipping_address_id
* description: The customer's default shipping address id.
* description: Filter by the ID of a customer's default shipping address.
* - type: array
* description: The customer's default shipping address id.
* description: Filter by the IDs of a customers' default shipping address.
* items:
* type: string
* title: default_shipping_address_id
* description: The default shipping address id's details.
* description: The ID of a customer's default shipping address.
* company_name:
* oneOf:
* - type: string
* title: company_name
* description: The customer's company name.
* description: Filter by a customer's company name.
* - type: array
* description: The customer's company name.
* description: Filter by customers' company names.
* items:
* type: string
* title: company_name
* description: The company name's details.
* description: A company name.
* first_name:
* oneOf:
* - type: string
* title: first_name
* description: The customer's first name.
* description: Filter by a customer's first name.
* - type: array
* description: The customer's first name.
* description: Filter by customers' first names.
* items:
* type: string
* title: first_name
* description: The first name's details.
* description: A first name.
* last_name:
* oneOf:
* - type: string
* title: last_name
* description: The customer's last name.
* description: Filter by a customer's last name.
* - type: array
* description: The customer's last name.
* description: Filter by customers' last names.
* items:
* type: string
* title: last_name
* description: The last name's details.
* description: A last name.
* created_by:
* oneOf:
* - type: string
* title: created_by
* description: The customer's created by.
* description: Filter by the ID of a user to retrieve the groups of the customers they created.
* - type: array
* description: The customer's created by.
* description: Filter by the ID of users to retrieve the groups of the customers they created.
* items:
* type: string
* title: created_by
* description: The created by's details.
* description: A user's ID.
* created_at:
* type: object
* description: The customer's created at.
* description: Filter the customer's creation date.
* properties:
* $and:
* type: array
@@ -230,7 +230,7 @@
* title: $eq
* description: Filter by an exact match.
* - type: array
* description: Filter by an exact match.
* description: Filter by exact matches
* items:
* type: string
* title: $eq
@@ -325,7 +325,7 @@
* description: Filter by whether a value for this parameter exists (not `null`).
* updated_at:
* type: object
* description: The customer's updated at.
* description: Filter the customer's update date.
* properties:
* $and:
* type: array
@@ -440,7 +440,7 @@
* description: Filter by whether a value for this parameter exists (not `null`).
* deleted_at:
* type: object
* description: The customer's deleted at.
* description: Filter the customer's deletion date.
* properties:
* $and:
* type: array

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminDeletePaymentCollectionResponse
* type: object
* description: SUMMARY
* description: The result of deleting the payment collection.
* x-schemaName: AdminDeletePaymentCollectionResponse
* required:
* - id
@@ -15,12 +15,12 @@
* object:
* type: string
* title: object
* description: SUMMARY
* description: The name of the object that was deleted.
* default: payment-collection
* deleted:
* type: boolean
* title: deleted
* description: SUMMARY
* description: Whether the object was deleted.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminDraftOrderResponse
* type: object
* description: SUMMARY
* description: The draft order's details.
* x-schemaName: AdminDraftOrderResponse
* required:
* - draft_order

View File

@@ -46,31 +46,32 @@
* order_id:
* type: string
* title: order_id
* description: The exchange's order id.
* description: The ID of the order the exchange is created for.
* return_items:
* type: array
* description: The exchange's return items.
* description: The items returned (inbound) by the exchange.
* items:
* $ref: "#/components/schemas/AdminReturnItem"
* additional_items:
* type: array
* description: The exchange's additional items.
* description: The new items (outbound) sent by the exchange.
* items:
* $ref: "#/components/schemas/BaseExchangeItem"
* no_notification:
* type: boolean
* title: no_notification
* description: The exchange's no notification.
* description: Whether to send the customer notifications when the exchange is updated.
* difference_due:
* type: number
* title: difference_due
* description: The exchange's difference due.
* description: The amount to be exchanged or refunded. If the amount is negative, it must be refunded. If positive, additional payment is required from the customer.
* return:
* description: the return associated with the exchange.
* $ref: "#/components/schemas/AdminReturn"
* return_id:
* type: string
* title: return_id
* description: The exchange's return id.
* description: The ID of the associated exchange.
* currency_code:
* type: string
* title: currency_code
@@ -82,31 +83,33 @@
* region_id:
* type: string
* title: region_id
* description: The exchange's region id.
* description: The ID of the associated order's region.
* customer_id:
* type: string
* title: customer_id
* description: The exchange's customer id.
* description: The ID of the customer that placed the order.
* sales_channel_id:
* type: string
* title: sales_channel_id
* description: The exchange's sales channel id.
* description: The ID of the sales channel the associated order belongs to.
* email:
* type: string
* title: email
* description: The exchange's email.
* description: The email used when placing the order.
* format: email
* display_id:
* type: number
* title: display_id
* description: The exchange's display id.
* description: The exchange's display ID.
* shipping_address:
* description: The shipping address to send new items to.
* $ref: "#/components/schemas/BaseOrderAddress"
* billing_address:
* description: The customer's billing address.
* $ref: "#/components/schemas/BaseOrderAddress"
* shipping_methods:
* type: array
* description: The exchange's shipping methods.
* description: The shipping methods used to send the new (outbound) items.
* items:
* $ref: "#/components/schemas/BaseOrderShippingMethod"
* payment_collections:
@@ -130,7 +133,7 @@
* - requires_action
* fulfillments:
* type: array
* description: The exchange's fulfillments.
* description: The exchange's fulfillments of new (outbound) items.
* items:
* $ref: "#/components/schemas/BaseOrderFulfillment"
* fulfillment_status:
@@ -148,87 +151,90 @@
* transactions:
* type: array
* description: The exchange's transactions.
* externalDocs:
* url: https://docs.medusajs.com/v2/resources/commerce-modules/order/transactions
* items:
* $ref: "#/components/schemas/BaseOrderTransaction"
* summary:
* description: The totals summary of the exchange.
* $ref: "#/components/schemas/BaseOrderSummary"
* metadata:
* type: object
* description: The exchange's metadata.
* description: The exchange's metadata, can hold custom key-value pairs.
* created_at:
* type: string
* format: date-time
* title: created_at
* description: The exchange's created at.
* description: The date that the exchange was created.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The exchange's updated at.
* description: The date that the exchange was updated.
* original_item_total:
* type: number
* title: original_item_total
* description: The exchange's original item total.
* description: The total of the original items in the order.
* original_item_subtotal:
* type: number
* title: original_item_subtotal
* description: The exchange's original item subtotal.
* description: The subtotal of the original items in the order.
* original_item_tax_total:
* type: number
* title: original_item_tax_total
* description: The exchange's original item tax total.
* description: The total tax of the original items in the order.
* item_total:
* type: number
* title: item_total
* description: The exchange's item total.
* description: The total of the exchange's new items.
* item_subtotal:
* type: number
* title: item_subtotal
* description: The exchange's item subtotal.
* description: The subtotal of the exchange's new items.
* item_tax_total:
* type: number
* title: item_tax_total
* description: The exchange's item tax total.
* description: The tax total of the exchange's new items.
* original_total:
* type: number
* title: original_total
* description: The exchange's original total.
* description: The total of the order.
* original_subtotal:
* type: number
* title: original_subtotal
* description: The exchange's original subtotal.
* description: The subtotal of the order.
* original_tax_total:
* type: number
* title: original_tax_total
* description: The exchange's original tax total.
* description: The tax total of the order.
* total:
* type: number
* title: total
* description: The exchange's total.
* description: The total of the exchange.
* subtotal:
* type: number
* title: subtotal
* description: The exchange's subtotal.
* description: The subtotal of the exchange.
* tax_total:
* type: number
* title: tax_total
* description: The exchange's tax total.
* description: The tax total of the exchange.
* discount_total:
* type: number
* title: discount_total
* description: The exchange's discount total.
* description: The discount total of the exchange.
* discount_tax_total:
* type: number
* title: discount_tax_total
* description: The exchange's discount tax total.
* description: The total taxes on discount of the exchange.
* gift_card_total:
* type: number
* title: gift_card_total
* description: The exchange's gift card total.
* description: The gift cards total of the exchange.
* gift_card_tax_total:
* type: number
* title: gift_card_tax_total
* description: The exchange's gift card tax total.
* description: The total taxes on the gift card of the exchange.
* shipping_total:
* type: number
* title: shipping_total
@@ -244,15 +250,15 @@
* original_shipping_total:
* type: number
* title: original_shipping_total
* description: The exchange's original shipping total.
* description: The order's shipping total.
* original_shipping_subtotal:
* type: number
* title: original_shipping_subtotal
* description: The exchange's original shipping subtotal.
* description: The order's shipping subtotal.
* original_shipping_tax_total:
* type: number
* title: original_shipping_tax_total
* description: The exchange's original shipping tax total.
* description: The order's shipping tax total.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminExchangeDeleteResponse
* type: object
* description: SUMMARY
* description: The details of deleting an exchange.
* x-schemaName: AdminExchangeDeleteResponse
* required:
* - id
@@ -20,7 +20,7 @@
* deleted:
* type: boolean
* title: deleted
* description: Whether the Exchange was deleted.
* description: Whether the exchange was deleted.
*
*/

View File

@@ -1,13 +1,14 @@
/**
* @schema AdminExchangeOrderResponse
* type: object
* description: SUMMARY
* description: The exchange's details.
* x-schemaName: AdminExchangeOrderResponse
* required:
* - order
* - exchange
* properties:
* order:
* description: The details of the associated order.
* $ref: "#/components/schemas/Order"
* exchange:
* $ref: "#/components/schemas/AdminExchange"

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminExchangePreviewResponse
* type: object
* description: SUMMARY
* description: A preview of the order once the exchange is applied.
* x-schemaName: AdminExchangePreviewResponse
* required:
* - order_preview

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminExchangeRequestResponse
* type: object
* description: SUMMARY
* description: The details of a requested exchange.
* x-schemaName: AdminExchangeRequestResponse
* required:
* - return
@@ -9,8 +9,10 @@
* - exchange
* properties:
* return:
* description: The associated return's details.
* $ref: "#/components/schemas/AdminReturn"
* order_preview:
* description: A preview of the order once the exchange is applied.
* $ref: "#/components/schemas/OrderPreview"
* exchange:
* $ref: "#/components/schemas/AdminExchange"

View File

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

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminExchangeReturnResponse
* type: object
* description: SUMMARY
* description: The details of an exchange's return.
* x-schemaName: AdminExchangeReturnResponse
* required:
* - order_preview

View File

@@ -1,8 +0,0 @@
/**
* @schema AdminExportProductRequest
* type: object
* description: SUMMARY
* x-schemaName: AdminExportProductRequest
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminExportProductResponse
* type: object
* description: SUMMARY
* description: The details of the product export.
* x-schemaName: AdminExportProductResponse
* required:
* - transaction_id
@@ -9,7 +9,7 @@
* transaction_id:
* type: string
* title: transaction_id
* description: The product's transaction id.
* description: The ID of the workflow execution's transaction. Use it to check the status of the export by sending a GET request to `/admin/workflows-executions/export-products/:transaction-id`
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminFile
* type: object
* description: The upload's file.
* description: A file's details.
* x-schemaName: AdminFile
* required:
* - id
@@ -14,7 +14,7 @@
* url:
* type: string
* title: url
* description: The file's url.
* description: The file's URL.
*
*/

View File

@@ -1,14 +1,14 @@
/**
* @schema AdminFileListResponse
* type: object
* description: SUMMARY
* description: The list of uploaded files.
* x-schemaName: AdminFileListResponse
* required:
* - files
* properties:
* files:
* type: array
* description: The upload's files.
* description: The list of uploaded files.
* items:
* $ref: "#/components/schemas/AdminFile"
*

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminFileResponse
* type: object
* description: SUMMARY
* description: A file's details.
* x-schemaName: AdminFileResponse
* required:
* - file

View File

@@ -29,18 +29,20 @@
* location_id:
* type: string
* title: location_id
* description: The fulfillment's location id.
* description: The ID of the location the fulfillment's items are shipped from.
* provider_id:
* type: string
* title: provider_id
* description: The fulfillment's provider id.
* description: The ID of the fulfillment provider handling this fulfillment.
* shipping_option_id:
* type: string
* title: shipping_option_id
* description: The fulfillment's shipping option id.
* description: The ID of the shipping option this fulfillment is created for.
* provider:
* description: The details of the fulfillment provider using to handle this fulfillment.
* $ref: "#/components/schemas/AdminFulfillmentProvider"
* delivery_address:
* description: The address to deliver the item to.
* $ref: "#/components/schemas/AdminFulfillmentAddress"
* items:
* type: array
@@ -49,46 +51,48 @@
* $ref: "#/components/schemas/AdminFulfillmentItem"
* labels:
* type: array
* description: The fulfillment's labels.
* description: The fulfillment's shipment labels.
* items:
* $ref: "#/components/schemas/AdminFulfillmentLabel"
* packed_at:
* type: string
* title: packed_at
* description: The fulfillment's packed at.
* description: The date the fulfillment was packed at.
* shipped_at:
* type: string
* title: shipped_at
* description: The fulfillment's shipped at.
* description: The date the fulfillment was shipped at.
* delivered_at:
* type: string
* title: delivered_at
* description: The fulfillment's delivered at.
* description: The date the fulfillment was delivered at.
* canceled_at:
* type: string
* title: canceled_at
* description: The fulfillment's canceled at.
* description: The date the fulfillment was canceled at.
* data:
* type: object
* description: The fulfillment's data.
* description: The fulfillment's data, useful for the third-party provider handling the fulfillment.
* externalDocs:
* url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property
* metadata:
* type: object
* description: The fulfillment's metadata.
* description: The fulfillment's metadata, can hold custom key-value pairs.
* created_at:
* type: string
* format: date-time
* title: created_at
* description: The fulfillment's created at.
* description: The date the fulfillment was created at.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The fulfillment's updated at.
* description: The date the fulfillment was updated at.
* deleted_at:
* type: string
* format: date-time
* title: deleted_at
* description: The fulfillment's deleted at.
* description: The date the fulfillment was deleted at.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminFulfillmentAddress
* type: object
* description: The fulfillment's delivery address.
* description: An address's details.
* x-schemaName: AdminFulfillmentAddress
* required:
* - id
@@ -24,69 +24,69 @@
* id:
* type: string
* title: id
* description: The delivery address's ID.
* description: The address's ID.
* fulfillment_id:
* type: string
* title: fulfillment_id
* description: The delivery address's fulfillment id.
* description: The ID of the fulfillment that the address belongs to.
* company:
* type: string
* title: company
* description: The delivery address's company.
* description: The address's company.
* first_name:
* type: string
* title: first_name
* description: The delivery address's first name.
* description: The address's first name.
* last_name:
* type: string
* title: last_name
* description: The delivery address's last name.
* description: The address's last name.
* address_1:
* type: string
* title: address_1
* description: The delivery address's address 1.
* description: The address's first line.
* address_2:
* type: string
* title: address_2
* description: The delivery address's address 2.
* description: The address's second line.
* city:
* type: string
* title: city
* description: The delivery address's city.
* description: The address's city.
* country_code:
* type: string
* title: country_code
* description: The delivery address's country code.
* description: The address's country code.
* province:
* type: string
* title: province
* description: The delivery address's province.
* description: The address's province.
* postal_code:
* type: string
* title: postal_code
* description: The delivery address's postal code.
* description: The address's postal code.
* phone:
* type: string
* title: phone
* description: The delivery address's phone.
* description: The address's phone.
* metadata:
* type: object
* description: The delivery address's metadata.
* description: The address's metadata, can hold custom key-value pairs.
* created_at:
* type: string
* format: date-time
* title: created_at
* description: The delivery address's created at.
* description: The date the address was created.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The delivery address's updated at.
* description: The date the address was updated.
* deleted_at:
* type: string
* format: date-time
* title: deleted_at
* description: The delivery address's deleted at.
* description: The date the address was deleted.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminFulfillmentItem
* type: object
* description: The item's items.
* description: The details of a fulfillment's item.
* x-schemaName: AdminFulfillmentItem
* required:
* - id
@@ -27,11 +27,11 @@
* quantity:
* type: number
* title: quantity
* description: The item's quantity.
* description: The item's quantity to be fulfilled.
* sku:
* type: string
* title: sku
* description: The item's sku.
* description: The item's SKU.
* barcode:
* type: string
* title: barcode
@@ -39,30 +39,30 @@
* line_item_id:
* type: string
* title: line_item_id
* description: The item's line item id.
* description: The ID of the order's line item to be fulfilled.
* inventory_item_id:
* type: string
* title: inventory_item_id
* description: The item's inventory item id.
* description: The ID of the inventory item of the underlying product variant.
* fulfillment_id:
* type: string
* title: fulfillment_id
* description: The item's fulfillment id.
* description: The ID of the fulfillment the item belongs to.
* created_at:
* type: string
* format: date-time
* title: created_at
* description: The item's created at.
* description: The date the item was created.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The item's updated at.
* description: The date the item was updated.
* deleted_at:
* type: string
* format: date-time
* title: deleted_at
* description: The item's deleted at.
* description: The date the item was deleted.
*
*/

View File

@@ -1,7 +1,7 @@
/**
* @schema AdminFulfillmentLabel
* type: object
* description: The label's labels.
* description: The details of a fulfillmet's shipment label.
* x-schemaName: AdminFulfillmentLabel
* required:
* - id
@@ -24,30 +24,30 @@
* tracking_url:
* type: string
* title: tracking_url
* description: The label's tracking url.
* description: The label's tracking URL.
* label_url:
* type: string
* title: label_url
* description: The label's label url.
* description: The label's URL.
* fulfillment_id:
* type: string
* title: fulfillment_id
* description: The label's fulfillment id.
* description: The ID of the fulfillment the label is associated with.
* created_at:
* type: string
* format: date-time
* title: created_at
* description: The label's created at.
* description: The date the label was created.
* updated_at:
* type: string
* format: date-time
* title: updated_at
* description: The label's updated at.
* description: The date the label was updated.
* deleted_at:
* type: string
* format: date-time
* title: deleted_at
* description: The label's deleted at.
* description: The date the label was deleted.
*
*/