mirror of
https://github.com/ferdikoomen/openapi-typescript-codegen.git
synced 2025-12-08 20:16:21 +00:00
Changed imports a bit to stop closer match project style
This commit is contained in:
parent
15fa2ac61a
commit
43a5786c92
@ -1,6 +1,7 @@
|
||||
import RefParser from '@apidevtools/json-schema-ref-parser';
|
||||
import { exists } from 'fs-extra';
|
||||
import path from 'path';
|
||||
import { resolve } from 'path';
|
||||
|
||||
import { exists } from './fileSystem';
|
||||
|
||||
/**
|
||||
* Load and parse te open api spec. If the file extension is ".yml" or ".yaml"
|
||||
@ -9,6 +10,6 @@ import path from 'path';
|
||||
* @param location: Path or url
|
||||
*/
|
||||
export const getOpenApiSpec = async (location: string): Promise<any> => {
|
||||
const absolutePathOrUrl = (await exists(location)) ? path.resolve(location) : location;
|
||||
const absolutePathOrUrl = (await exists(location)) ? resolve(location) : location;
|
||||
return await RefParser.bundle(absolutePathOrUrl, absolutePathOrUrl, {});
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user