-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid dereferencing before caching (#2793)
- Loading branch information
Showing
8 changed files
with
56,008 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@gitbook/react-openapi': patch | ||
'gitbook': patch | ||
--- | ||
|
||
Do not dereference before caching OpenAPI spec. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55,942 changes: 55,942 additions & 0 deletions
55,942
packages/react-openapi/src/parser/fixtures/spec-example.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { expect, it } from 'bun:test'; | ||
import { readFile } from 'node:fs/promises'; | ||
import { parseOpenAPI } from '.'; | ||
|
||
it('should parse and not give a recursive structure', async () => { | ||
const schema = await parseOpenAPI({ | ||
value: await readFile(new URL('./fixtures/spec-example.json', import.meta.url), 'utf-8'), | ||
url: 'https://example.com', | ||
parseMarkdown: async (input) => input, | ||
}); | ||
|
||
JSON.stringify(schema); | ||
expect(schema.openapi).toBe('3.0.0'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters