Skip to content

Commit e55905b

Browse files
committed
Add example auth headers to postman request
1 parent 2c55680 commit e55905b

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/buildPostmanRequest.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* LICENSE file in the root directory of this source tree.
66
* ========================================================================== */
77

8-
import sdk from "@paloaltonetworks/postman-collection";
9-
import { AuthState, Scheme } from "@theme/ApiExplorer/Authorization/slice";
10-
import { Body, Content } from "@theme/ApiExplorer/Body/slice";
118
import {
129
ParameterObject,
1310
ServerObject,
1411
} from "@mxenabled/docusaurus-plugin-openapi-docs/src/openapi/types";
12+
import sdk from "@paloaltonetworks/postman-collection";
13+
import { AuthState, Scheme } from "@theme/ApiExplorer/Authorization/slice";
14+
import { Body, Content } from "@theme/ApiExplorer/Body/slice";
1515
import cloneDeep from "lodash/cloneDeep";
1616

1717
type Param = {
@@ -283,6 +283,10 @@ function buildPostmanRequest(
283283
if (a.type === "http" && a.scheme === "basic") {
284284
const { username, password } = auth.data[a.key];
285285
if (username === undefined || password === undefined) {
286+
otherHeaders.push({
287+
key: "Authorization",
288+
value: "Basic BASE_64_ENCODING_OF{client_id:api_key}",
289+
});
286290
continue;
287291
}
288292
otherHeaders.push({

0 commit comments

Comments
 (0)