- Fixed bundle when loading from url and resolving relative paths

This commit is contained in:
Ferdi Koomen 2021-10-28 21:17:24 +02:00
parent 2070f9599f
commit 5a7c58873f
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "openapi-typescript-codegen",
"version": "0.11.4",
"version": "0.11.5",
"description": "Library that generates Typescript clients based on the OpenAPI specification.",
"author": "Ferdi Koomen",
"homepage": "https://github.com/ferdikoomen/openapi-typescript-codegen",

View File

@ -4,8 +4,8 @@ import RefParser from 'json-schema-ref-parser';
* Load and parse te open api spec. If the file extension is ".yml" or ".yaml"
* we will try to parse the file as a YAML spec, otherwise we will fallback
* on parsing the file as JSON.
* @param input
* @param location: Path or url
*/
export async function getOpenApiSpec(input: string): Promise<any> {
return await RefParser.bundle(input);
export async function getOpenApiSpec(location: string): Promise<any> {
return await RefParser.bundle(location, location, {});
}