Skip to content

Commit

Permalink
docs-util: add publishable api key header parameter to store routes OAS
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser committed Dec 26, 2024
1 parent b9e7090 commit 8462c08
Show file tree
Hide file tree
Showing 89 changed files with 1,258 additions and 16 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
9 changes: 7 additions & 2 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
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
Loading

0 comments on commit 8462c08

Please sign in to comment.