docs-util: fixes for circular references, PAK in examples, namespaces (#9091)

- Fix circular references in generated OAS comments by cloning objects
- Add publishable API key in the header of store cURL examples + change the admin authentication header to use bearer tokens.
- Add plugin to generate namespaces from the `@customNamespace` tag in TSDocs, this was available before but was removed.
- Other fixes related to re-using schemas, overwritten descriptions, and smaller fixes
This commit is contained in:
Shahed Nasser
2024-09-16 20:55:05 +03:00
committed by GitHub
parent 05c88268d3
commit cb79a5dbff
10 changed files with 448 additions and 42 deletions

View File

@@ -216,11 +216,15 @@ class OasExamplesGenerator {
]
if (isAdminAuthenticated) {
exampleArr.push(`-H 'x-medusa-access-token: {api_token}'`)
exampleArr.push(`-H 'Authorization: Bearer {access_token}'`)
} else if (isStoreAuthenticated) {
exampleArr.push(`-H 'Authorization: Bearer {access_token}'`)
}
if (path.startsWith("/store")) {
exampleArr.push(`-H 'x-publishable-api-key: {your_publishable_api_key}'`)
}
if (requestSchema) {
const requestData = this.getSchemaRequiredData(requestSchema)