(
input: Pick<ParseOpenAPIInput, 'value' | 'rootURL' | 'options'>
)
| 10 | * Fetches all the URLs specified in references and builds a filesystem. |
| 11 | */ |
| 12 | export async function createFileSystem( |
| 13 | input: Pick<ParseOpenAPIInput, 'value' | 'rootURL' | 'options'> |
| 14 | ): Promise<Filesystem> { |
| 15 | const { value, rootURL, options } = input; |
| 16 | |
| 17 | const result = await bundle(value, { |
| 18 | treeShake: false, |
| 19 | plugins: [ |
| 20 | fetchURL(), |
| 21 | parseYaml(), |
| 22 | parseJson(), |
| 23 | fetchURLs({ rootURL }), |
| 24 | ...(options?.plugins || []), |
| 25 | ], |
| 26 | }); |
| 27 | |
| 28 | return [ |
| 29 | { |
| 30 | dir: '.', |
| 31 | isEntrypoint: true, |
| 32 | references: [], |
| 33 | filename: 'openapi.json', |
| 34 | specification: result, |
| 35 | }, |
| 36 | ]; |
| 37 | } |
no test coverage detected