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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user