MCPcopy Index your code
hub / github.com/GitbookIO/gitbook / parseOpenAPI

Function parseOpenAPI

packages/openapi-parser/src/parse.ts:42–51  ·  view source on GitHub ↗
(input: ParseOpenAPIInput)

Source from the content-addressed store, hash-verified

40 * It can throw an `OpenAPIParseError` if the document is invalid.
41 */
42export async function parseOpenAPI(input: ParseOpenAPIInput) {
43 try {
44 return await parseOpenAPIV3(input);
45 } catch (error) {
46 if (error instanceof OpenAPIParseError && error.code === 'parse-v2-in-v3') {
47 return convertOpenAPIV2ToOpenAPIV3(input);
48 }
49 throw error;
50 }
51}

Callers 5

fetchFilesystemFunction · 0.90
fetchFilesystemFunction · 0.90
parse.test.tsFile · 0.90
enrich.test.tsFile · 0.90
fetchFilesystemNoCacheFunction · 0.90

Calls 2

parseOpenAPIV3Function · 0.90

Tested by 2

fetchFilesystemFunction · 0.72
fetchFilesystemFunction · 0.72