Skip to content

Commit 98c5f17

Browse files
committed
Add serialized sample responses to frontmatter
1 parent 19a08a1 commit 98c5f17

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ yarn-error.log*
3131
.yarn/
3232
.yarnrc.yml
3333

34+
.vscode/*
35+
3436
# Logs
3537
logs
3638
*.log

packages/docusaurus-plugin-openapi-docs/src/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,14 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
321321

322322
if (statusCodes.length) {
323323
// opportunity to compress JSON
324-
item.sampleResponses = {
324+
const sampleResponses = {
325325
statusCodes,
326-
responseExamples: zlib
327-
.deflateSync(JSON.stringify(responseExamples))
328-
.toString("base64"),
326+
responseExamples,
329327
};
328+
329+
item.sampleResponses = zlib
330+
.deflateSync(JSON.stringify(sampleResponses))
331+
.toString("base64");
330332
}
331333
}
332334

0 commit comments

Comments
 (0)