Skip to content

Commit

Permalink
docs-util: add publishable api key header parameter to store routes O…
Browse files Browse the repository at this point in the history
…AS (medusajs#10747)

* docs-util: add publishable api key header parameter to store routes OAS

* fix oas
  • Loading branch information
shahednasser authored and noubase committed Jan 22, 2025
1 parent be1845e commit 205e0b7
Show file tree
Hide file tree
Showing 92 changed files with 1,268 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const TagsOperationDescriptionSectionParameters = ({
required: [],
properties: {},
}
const headerParameters: SchemaObject = {
type: "object",
required: [],
properties: {},
}

parameters.forEach((parameter) => {
const parameterObject = {
Expand All @@ -37,11 +42,27 @@ const TagsOperationDescriptionSectionParameters = ({
queryParameters.required?.push(parameter.name)
}
queryParameters.properties[parameter.name] = parameterObject
} else if (parameter.in === "header") {
if (parameter.required) {
headerParameters.required?.push(parameter.name)
}
headerParameters.properties[parameter.name] = parameterObject
}
})

return (
<>
{Object.values(headerParameters.properties).length > 0 && (
<>
<h3 className="border-medusa-border-base border-b py-1.5">
Header Parameters
</h3>
<TagOperationParameters
schemaObject={headerParameters}
topLevel={true}
/>
</>
)}
{Object.values(pathParameters.properties).length > 0 && (
<>
<h3 className="border-medusa-border-base border-b py-1.5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ properties:
title: id
description: The price rule's ID.
value:
type: string
title: value
oneOf:
- type: string
title: value
description: The price rule's value.
- type: number
title: value
description: The price rule's value.
description: The price rule's value.
operator:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,8 @@ properties:
description: The shipping option rule's operator.
example: eq
value:
oneOf:
- type: string
title: value
description: The rule's value.
example: '"true"'
- type: array
description: The rule's values.
items:
type: string
title: value
description: A rule's value
example: '"true"'
type: string
title: value
shipping_option_id:
type: string
title: shipping_option_id
Expand Down
23 changes: 9 additions & 14 deletions www/apps/api-reference/specs/admin/openapi.full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53046,8 +53046,13 @@ components:
title: id
description: The price rule's ID.
value:
type: string
title: value
oneOf:
- type: string
title: value
description: The price rule's value.
- type: number
title: value
description: The price rule's value.
description: The price rule's value.
operator:
type: string
Expand Down Expand Up @@ -53126,18 +53131,8 @@ components:
description: The shipping option rule's operator.
example: eq
value:
oneOf:
- type: string
title: value
description: The rule's value.
example: '"true"'
- type: array
description: The rule's values.
items:
type: string
title: value
description: A rule's value
example: '"true"'
type: string
title: value
shipping_option_id:
type: string
title: shipping_option_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ properties:
title: id
description: The price rule's ID.
value:
type: string
title: value
oneOf:
- type: string
title: value
description: The price rule's value.
- type: number
title: value
description: The price rule's value.
description: The price rule's value.
operator:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,8 @@ properties:
description: The shipping option rule's operator.
example: eq
value:
oneOf:
- type: string
title: value
description: The rule's value.
example: '"true"'
- type: array
description: The rule's values.
items:
type: string
title: value
description: A rule's value
example: '"true"'
type: string
title: value
shipping_option_id:
type: string
title: shipping_option_id
Expand Down
Loading

0 comments on commit 205e0b7

Please sign in to comment.