We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15fa2ac commit 43a5786Copy full SHA for 43a5786
src/utils/getOpenApiSpec.ts
@@ -1,6 +1,7 @@
1
import RefParser from '@apidevtools/json-schema-ref-parser';
2
-import { exists } from 'fs-extra';
3
-import path from 'path';
+import { resolve } from 'path';
+
4
+import { exists } from './fileSystem';
5
6
/**
7
* Load and parse te open api spec. If the file extension is ".yml" or ".yaml"
@@ -9,6 +10,6 @@ import path from 'path';
9
10
* @param location: Path or url
11
*/
12
export const getOpenApiSpec = async (location: string): Promise<any> => {
- const absolutePathOrUrl = (await exists(location)) ? path.resolve(location) : location;
13
+ const absolutePathOrUrl = (await exists(location)) ? resolve(location) : location;
14
return await RefParser.bundle(absolutePathOrUrl, absolutePathOrUrl, {});
15
};
0 commit comments