From 5a7c58873f1870c5ad870938a73ec9c78b6cbbcb Mon Sep 17 00:00:00 2001 From: Ferdi Koomen Date: Thu, 28 Oct 2021 21:17:24 +0200 Subject: [PATCH] - Fixed bundle when loading from url and resolving relative paths --- package.json | 2 +- src/utils/getOpenApiSpec.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index e32b5e42..70043fe0 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/utils/getOpenApiSpec.ts b/src/utils/getOpenApiSpec.ts index 8302d238..0d6407f0 100644 --- a/src/utils/getOpenApiSpec.ts +++ b/src/utils/getOpenApiSpec.ts @@ -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 { - return await RefParser.bundle(input); +export async function getOpenApiSpec(location: string): Promise { + return await RefParser.bundle(location, location, {}); }