docs: fix to OAS generator following Zod update + generate API reference (#13030)

This commit is contained in:
Shahed Nasser
2025-07-24 14:36:28 +03:00
committed by GitHub
parent 3921c86e19
commit 9bb4c0306b
126 changed files with 4855 additions and 2689 deletions

View File

@@ -37,143 +37,7 @@ post:
content:
application/json:
schema:
type: object
description: The service zone's details.
required:
- name
properties:
name:
type: string
title: name
description: The service zone's name.
geo_zones:
type: array
description: The service zone's geo zones.
items:
oneOf:
- type: object
description: A country geo zone.
required:
- metadata
- country_code
- type
properties:
metadata:
type: object
description: The geo zone's metadata.
country_code:
type: string
title: country_code
description: The geo zone's country code.
type:
type: string
title: type
description: The geo zone's type.
default: country
- type: object
description: A province geo zone.
required:
- metadata
- country_code
- type
- province_code
properties:
metadata:
type: object
description: The geo zone's metadata.
country_code:
type: string
title: country_code
description: The geo zone's country code.
type:
type: string
title: type
description: The geo zone's type.
default: province
province_code:
type: string
title: province_code
description: >-
The geo zone's ISO 3166-2 province code. Must be
lower-case.
example: us-ca
externalDocs:
url: https://en.wikipedia.org/wiki/ISO_3166-2
description: Learn more about ISO 3166-2
- type: object
description: A city geo zone
required:
- metadata
- country_code
- type
- province_code
- city
properties:
metadata:
type: object
description: The geo zone's metadata.
country_code:
type: string
title: country_code
description: The geo zone's country code.
type:
type: string
title: type
description: The geo zone's type.
default: city
province_code:
type: string
title: province_code
description: >-
The geo zone's ISO 3166-2 province code. Must be
lower-case.
example: us-ca
externalDocs:
url: https://en.wikipedia.org/wiki/ISO_3166-2
description: Learn more about ISO 3166-2
city:
type: string
title: city
description: The geo zone's city.
- type: object
description: A ZIP geo zone.
required:
- metadata
- country_code
- type
- province_code
- city
- postal_expression
properties:
metadata:
type: object
description: The geo zone's metadata.
country_code:
type: string
title: country_code
description: The geo zone's country code.
type:
type: string
title: type
description: The geo zone's type.
default: zip
province_code:
type: string
title: province_code
description: >-
The geo zone's ISO 3166-2 province code. Must be
lower-case.
example: us-ca
externalDocs:
url: https://en.wikipedia.org/wiki/ISO_3166-2
description: Learn more about ISO 3166-2
city:
type: string
title: city
description: The geo zone's city.
postal_expression:
type: object
description: The geo zone's postal expression or ZIP code.
$ref: ../components/schemas/AdminCreateFulfillmentSetServiceZones.yaml
x-codeSamples:
- lang: JavaScript
label: JS SDK

View File

@@ -116,157 +116,7 @@ post:
content:
application/json:
schema:
type: object
description: The service zone's details.
properties:
name:
type: string
title: name
description: The service zone's name.
geo_zones:
type: array
description: The service zone's associated geo zones.
items:
oneOf:
- type: object
description: A country geo zone.
required:
- type
- metadata
- country_code
properties:
type:
type: string
title: type
description: The geo zone's type.
default: country
metadata:
type: object
description: The geo zone's metadata.
country_code:
type: string
title: country_code
description: The geo zone's country code.
id:
type: string
title: id
description: The ID of an existing geo zone.
- type: object
description: A province geo zone.
required:
- type
- metadata
- country_code
- province_code
properties:
type:
type: string
title: type
description: The geo zone's type.
default: province
metadata:
type: object
description: The geo zone's metadata.
country_code:
type: string
title: country_code
description: The geo zone's country code.
province_code:
type: string
title: province_code
description: >-
The geo zone's ISO 3166-2 province code. Must be
lower-case.
example: us-ca
externalDocs:
url: https://en.wikipedia.org/wiki/ISO_3166-2
description: Learn more about ISO 3166-2
id:
type: string
title: id
description: The ID of an existing geo zone.
- type: object
description: A city geo zone
required:
- type
- metadata
- city
- country_code
- province_code
properties:
type:
type: string
title: type
description: The geo zone's type.
default: city
metadata:
type: object
description: The geo zone's metadata.
city:
type: string
title: city
description: The geo zone's city.
country_code:
type: string
title: country_code
description: The geo zone's country code.
province_code:
type: string
title: province_code
description: >-
The geo zone's ISO 3166-2 province code. Must be
lower-case.
example: us-ca
externalDocs:
url: https://en.wikipedia.org/wiki/ISO_3166-2
description: Learn more about ISO 3166-2
id:
type: string
title: id
description: The ID of an existing geo zone.
- type: object
description: A ZIP geo zone.
required:
- type
- metadata
- city
- country_code
- province_code
- postal_expression
properties:
type:
type: string
title: type
description: The geo zone's type.
default: zip
metadata:
type: object
description: The geo zone's metadata.
city:
type: string
title: city
description: The geo zone's city.
country_code:
type: string
title: country_code
description: The geo zone's country code.
province_code:
type: string
title: province_code
description: >-
The geo zone's ISO 3166-2 province code. Must be
lower-case.
example: us-ca
externalDocs:
url: https://en.wikipedia.org/wiki/ISO_3166-2
description: Learn more about ISO 3166-2
postal_expression:
type: object
description: The geo zone's postal expression or ZIP code.
id:
type: string
title: id
description: The ID of an existing geo zone.
$ref: ../components/schemas/AdminUpdateFulfillmentSetServiceZones.yaml
x-codeSamples:
- lang: JavaScript
label: JS SDK

View File

@@ -102,69 +102,7 @@ post:
content:
application/json:
schema:
type: object
description: The properties to update in the inventory item.
properties:
sku:
type: string
title: sku
description: The inventory item's SKU.
hs_code:
type: string
title: hs_code
description: The inventory item's HS code.
weight:
type: number
title: weight
description: The inventory item's weight.
length:
type: number
title: length
description: The inventory item's length.
height:
type: number
title: height
description: The inventory item's height.
width:
type: number
title: width
description: The inventory item's width.
origin_country:
type: string
title: origin_country
description: The inventory item's origin country.
mid_code:
type: string
title: mid_code
description: The inventory item's MID code.
material:
type: string
title: material
description: The inventory item's material.
title:
type: string
title: title
description: The inventory item's title.
description:
type: string
title: description
description: The inventory item's description.
requires_shipping:
type: boolean
title: requires_shipping
description: Whether the inventory item requires shipping.
thumbnail:
type: string
title: thumbnail
description: >-
The URL of an image to be used as the inventory item's
thumbnail. You can use the Upload API routes to upload an image
and get its URL.
metadata:
type: object
description: >-
The inventory item's metadata. Can be custom data in key-value
pairs.
$ref: ../components/schemas/AdminUpdateInventoryItem.yaml
x-codeSamples:
- lang: JavaScript
label: JS SDK

View File

@@ -200,23 +200,7 @@ post:
content:
application/json:
schema:
type: object
description: The inventory level's details.
required:
- location_id
properties:
location_id:
type: string
title: location_id
description: The ID of the associated location.
stocked_quantity:
type: number
title: stocked_quantity
description: The inventory level's stocked quantity.
incoming_quantity:
type: number
title: incoming_quantity
description: The inventory level's incoming quantity.
$ref: ../components/schemas/AdminCreateInventoryLocationLevel.yaml
x-codeSamples:
- lang: Shell
label: cURL

View File

@@ -45,17 +45,7 @@ post:
content:
application/json:
schema:
type: object
description: The properties to update in the inventory level.
properties:
stocked_quantity:
type: number
title: stocked_quantity
description: The inventory level's stocked quantity.
incoming_quantity:
type: number
title: incoming_quantity
description: The inventory level's incoming quantity.
$ref: ../components/schemas/AdminUpdateInventoryLocationLevel.yaml
x-codeSamples:
- lang: JavaScript
label: JS SDK

View File

@@ -13,22 +13,7 @@ post:
content:
application/json:
schema:
type: object
description: The details of the user to be created.
properties:
email:
type: string
title: email
description: The user's email.
format: email
first_name:
type: string
title: first_name
description: The user's first name.
last_name:
type: string
title: last_name
description: The user's last name.
$ref: ../components/schemas/AdminInviteAccept.yaml
x-codeSamples:
- lang: JavaScript
label: JS SDK

View File

@@ -33,6 +33,10 @@ post:
- cookie_auth: []
- jwt_token: []
x-codeSamples:
- lang: JavaScript
label: JS SDK
source:
$ref: ../code_samples/JavaScript/admin_orders_{id}_archive/post.js
- lang: Shell
label: cURL
source:

View File

@@ -48,6 +48,10 @@ post:
passed to the underlying workflow under the `additional_data`
parameter.
x-codeSamples:
- lang: JavaScript
label: JS SDK
source:
$ref: ../code_samples/JavaScript/admin_orders_{id}_complete/post.js
- lang: Shell
label: cURL
source:

View File

@@ -30,20 +30,7 @@ post:
content:
application/json:
schema:
type: object
description: The payment collection's details.
required:
- order_id
- amount
properties:
order_id:
type: string
title: order_id
description: The ID of the associated order.
amount:
type: number
title: amount
description: The amount to be paid.
$ref: ../components/schemas/AdminCreatePaymentCollection.yaml
x-codeSamples:
- lang: JavaScript
label: JS SDK

View File

@@ -39,15 +39,7 @@ post:
content:
application/json:
schema:
type: object
description: The payment details.
required:
- order_id
properties:
order_id:
type: string
title: order_id
description: The ID of the order associated with the payment collection.
$ref: ../components/schemas/AdminMarkPaymentCollectionPaid.yaml
x-codeSamples:
- lang: JavaScript
label: JS SDK

View File

@@ -38,13 +38,7 @@ post:
content:
application/json:
schema:
type: object
description: The payment's details.
properties:
amount:
type: number
title: amount
description: The amount to capture.
$ref: ../components/schemas/AdminCreatePaymentCapture.yaml
x-codeSamples:
- lang: JavaScript
label: JS SDK

View File

@@ -38,21 +38,7 @@ post:
content:
application/json:
schema:
type: object
description: The refund's details.
properties:
amount:
type: number
title: amount
description: The amount to refund.
refund_reason_id:
type: string
title: refund_reason_id
description: The ID of a refund reason.
note:
type: string
title: note
description: A note to attach to the refund.
$ref: ../components/schemas/AdminCreatePaymentRefund.yaml
x-codeSamples:
- lang: JavaScript
label: JS SDK

View File

@@ -158,44 +158,7 @@ post:
content:
application/json:
schema:
type: object
description: The properties to update in the product category.
properties:
name:
type: string
title: name
description: The product category's name.
description:
type: string
title: description
description: The product category's description.
handle:
type: string
title: handle
description: The product category's handle. Must be a unique value.
is_internal:
type: boolean
title: is_internal
description: >-
Whether the product category is only used for internal purposes
and shouldn't be shown the customer.
is_active:
type: boolean
title: is_active
description: Whether the product category is active.
parent_category_id:
type: string
title: parent_category_id
description: The ID of a parent category.
metadata:
type: object
description: >-
The product category's metadata. Can hold custom key-value
pairs.
rank:
type: number
title: rank
description: The product category's rank among other categories.
$ref: ../components/schemas/AdminUpdateProductCategory.yaml
x-codeSamples:
- lang: JavaScript
label: JS SDK

View File

@@ -102,16 +102,7 @@ post:
content:
application/json:
schema:
type: object
description: The properties to update in the product tag.
properties:
value:
type: string
title: value
description: The product tag's value.
metadata:
type: object
description: The product tag's metadata. Can hold custom key-value pairs.
$ref: ../components/schemas/AdminUpdateProductTag.yaml
x-codeSamples:
- lang: JavaScript
label: JS SDK

View File

@@ -102,16 +102,7 @@ post:
content:
application/json:
schema:
type: object
description: The properties to update in the product type.
properties:
value:
type: string
title: value
description: The product type's value.
metadata:
type: object
description: The product type's metadata. Can hold custom key-value pairs.
$ref: ../components/schemas/AdminUpdateProductType.yaml
x-codeSamples:
- lang: JavaScript
label: JS SDK

View File

@@ -98,17 +98,7 @@ post:
content:
application/json:
schema:
type: object
description: The properties to update in the refund reason.
properties:
label:
type: string
title: label
description: The refund reason's label.
description:
type: string
title: description
description: The refund reason's description.
$ref: ../components/schemas/AdminUpdatePaymentRefundReason.yaml
x-codeSamples:
- lang: Shell
label: cURL

View File

@@ -102,44 +102,7 @@ post:
content:
application/json:
schema:
type: object
description: The propeties to update in the region.
properties:
name:
type: string
title: name
description: The region's name.
currency_code:
type: string
title: currency_code
description: The region's currency code.
countries:
type: array
description: The region's countries.
items:
type: string
title: countries
description: A country code.
automatic_taxes:
type: boolean
title: automatic_taxes
description: >-
Whether taxes are calculated automatically for carts in the
region.
payment_providers:
type: array
description: The payment providers enabled in the region.
items:
type: string
title: payment_providers
description: A payment provider's ID.
metadata:
type: object
description: The region's metadata. Can hold custom key-value pairs.
is_tax_inclusive:
type: boolean
title: is_tax_inclusive
description: Whether the prices in the region are tax inclusive.
$ref: ../components/schemas/AdminUpdateRegion.yaml
x-codeSamples:
- lang: JavaScript
label: JS SDK

View File

@@ -102,24 +102,7 @@ post:
content:
application/json:
schema:
type: object
description: The properties to update in the reservation.
properties:
location_id:
type: string
title: location_id
description: The ID of the associated location.
quantity:
type: number
title: quantity
description: The reserved quantity.
description:
type: string
title: description
description: The reservation's description.
metadata:
type: object
description: The reservation's metadata. Can hold custom key-value pairs.
$ref: ../components/schemas/AdminUpdateReservation.yaml
x-codeSamples:
- lang: JavaScript
label: JS SDK

View File

@@ -104,186 +104,7 @@ post:
content:
application/json:
schema:
type: object
description: The properties to update in the shipping option.
properties:
name:
type: string
title: name
description: The shipping option's name.
data:
type: object
description: >-
The shipping option's data that is useful for third-party
providers.
externalDocs:
url: >-
https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property
price_type:
type: string
description: >
The type of the shipping option's price. If `calculated`, its
price is retrieved by the associated fulfillment provider
during checkout. If `flat`, its price is set in the `prices`
property.
enum:
- calculated
- flat
provider_id:
type: string
title: provider_id
description: >-
The ID of the associated fulfillment provider that is used to
process the option.
shipping_profile_id:
type: string
title: shipping_profile_id
description: The ID of the shipping profile this shipping option belongs to.
type:
type: object
description: The shipping option's type.
required:
- code
- description
- label
properties:
label:
type: string
title: label
description: The type's label.
description:
type: string
title: description
description: The type's description.
code:
type: string
title: code
description: The type's code.
prices:
type: array
description: >-
The shipping option's prices. If the `price_type` is
`calculated`, pass an empty array.
items:
oneOf:
- type: object
description: The shipping option's price for a currency code.
properties:
id:
type: string
title: id
description: The ID of an existing price.
currency_code:
type: string
title: currency_code
description: The price's currency code.
amount:
type: number
title: amount
description: The price's amount.
- type: object
description: The shipping option's price for a region.
properties:
id:
type: string
title: id
description: The ID of an existing price.
region_id:
type: string
title: region_id
description: The ID of the associated region.
amount:
type: number
title: amount
description: The price's amount.
rules:
type: array
description: The shipping option's rules.
items:
oneOf:
- type: object
description: The details of a new shipping option rule.
required:
- operator
- attribute
- value
properties:
operator:
type: string
description: The operator used to check whether a rule applies.
enum:
- in
- eq
- ne
- gt
- gte
- lt
- lte
- nin
attribute:
type: string
title: attribute
description: >-
The name of a property or table that the rule applies
to.
example: customer_group
value:
oneOf:
- type: string
title: value
description: A value of the attribute that enables this rule.
example: cusgroup_123
- type: array
description: Values of the attribute that enable this rule.
items:
type: string
title: value
description: A value of the attribute that enables this rule.
example: cusgroup_123
- type: object
description: Update the properties of an existing rule.
required:
- id
- operator
- attribute
- value
properties:
id:
type: string
title: id
description: The rule's ID.
operator:
type: string
description: The operator used to check whether a rule applies.
enum:
- in
- eq
- ne
- gt
- gte
- lt
- lte
- nin
attribute:
type: string
title: attribute
description: >-
The name of a property or table that the rule applies
to.
example: customer_group
value:
oneOf:
- type: string
title: value
description: A value of the attribute that enables this rule.
example: cusgroup_123
- type: array
description: Values of the attribute that enable this rule.
items:
type: string
title: value
description: A value of the attribute that enables this rule.
example: cusgroup_123
$ref: ../components/schemas/AdminUpdateShippingOption.yaml
x-codeSamples:
- lang: JavaScript
label: JS SDK

View File

@@ -102,20 +102,7 @@ post:
content:
application/json:
schema:
type: object
description: The properties to update in the shipping profile.
properties:
name:
type: string
title: name
description: The shipping profile's name.
type:
type: string
title: type
description: The shipping profile's type.
metadata:
type: object
description: The shipping profile's metadata.
$ref: ../components/schemas/AdminUpdateShippingProfile.yaml
x-codeSamples:
- lang: JavaScript
label: JS SDK

View File

@@ -37,20 +37,7 @@ post:
content:
application/json:
schema:
type: object
description: The fulfillment set to create.
required:
- type
- name
properties:
name:
type: string
title: name
description: The fulfillment set's name.
type:
type: string
title: type
description: The fulfillment set's type.
$ref: ../components/schemas/AdminCreateStockLocationFulfillmentSet.yaml
x-codeSamples:
- lang: JavaScript
label: JS SDK