From 9690f07bc062c85fcf8b7f0f35a162b930944183 Mon Sep 17 00:00:00 2001 From: Patrick <116003638+patrick-medusajs@users.noreply.github.com> Date: Fri, 17 Feb 2023 07:42:11 -0500 Subject: [PATCH] fix(oas): patch circular references in docs (#3285) ## What Patch OAS circular references that causes the documentation to crash ## Test * Run `yarn openapi:generate` * Run `yarn redocly preview-docs docs/api/admin/openapi.yaml --config=./docs-util/redocly/config.yaml` * Open preview docs url in a browser * Expect the page to not crash * Repeat with `yarn redocly preview-docs docs/api/store/openapi.yaml --config=./docs-util/redocly/config.yaml` --- .changeset/brave-crabs-itch.md | 5 +++ docs-util/redocly/config.yaml | 61 +++++++++++++++++++++++++++++++++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 .changeset/brave-crabs-itch.md diff --git a/.changeset/brave-crabs-itch.md b/.changeset/brave-crabs-itch.md new file mode 100644 index 0000000000..70745b9371 --- /dev/null +++ b/.changeset/brave-crabs-itch.md @@ -0,0 +1,5 @@ +--- +"@medusajs/medusa": patch +--- + +fix(oas): patch circular references in docs diff --git a/docs-util/redocly/config.yaml b/docs-util/redocly/config.yaml index 75b593dc46..df0664a542 100644 --- a/docs-util/redocly/config.yaml +++ b/docs-util/redocly/config.yaml @@ -5,7 +5,7 @@ plugins: # when Redocly attempts to render circular references. decorators: plugin/circular-patch: - verbose: true + verbose: false schemas: Address: - Customer @@ -13,14 +13,26 @@ decorators: - Customer - Order - Payment + - PaymentSession + ClaimImage: + - ClaimItem ClaimItem: - ClaimOrder ClaimOrder: - Fulfillment - Order - Return + Country: + - Region Customer: - Order + CustomerGroup: + - Customer + - PriceList + Discount: + - Discount + DiscountRule: + - DiscountCondition DraftOrder: - Cart - Order @@ -28,6 +40,8 @@ decorators: - ClaimOrder - Order - Swap + FulfillmentItem: + - Fulfillment GiftCard: - Order GiftCardTransaction: @@ -39,6 +53,16 @@ decorators: - Order - OrderEdit - Swap + LineItemAdjustment: + - LineItem + LineItemTaxLine: + - LineItem + MoneyAmount: + - PriceList + - ProductVariant + - Region + Notification: + - Notification Order: - Cart - ClaimOrder @@ -52,10 +76,26 @@ decorators: - Swap OrderEdit: - Order + OrderItemChange: + - OrderEdit Payment: - Cart - Order - Swap + ProductCategory: + - ProductCategory + - Product + ProductCollection: + - Product + ProductOption: + - Product + ProductOptionValue: + - ProductOption + - ProductVariant + ProductVariant: + - Product + ProductVariantInventoryItem: + - ProductVariant Refund: - Order - Payment @@ -63,6 +103,12 @@ decorators: - ClaimOrder - Order - Swap + ReturnItem: + - Return + ReturnReason: + - ReturnReason + SalesChannelLocation: + - SalesChannel ShippingMethod: - Cart - ClaimOrder @@ -70,12 +116,25 @@ decorators: - Payment - Return - Swap + ShippingMethodTaxLine: + - ShippingMethod + ShippingOption: + - Region + ShippingOptionRequirement: + - ShippingOption + ShippingProfile: + - Product + - ShippingOption Swap: - Cart - Fulfillment - Order - Payment - Return + TaxRate: + - Region + TrackingLink: + - Fulfillment # Similar config to /www/docs/docusaurus.config.js > redocusaurus # Allows to emulate rendering of API public documentation when using `yarn redocly preview-docs openapi.yaml`