From 9759725aeaedf7985935bf31c20c43be878dca4a Mon Sep 17 00:00:00 2001 From: Hugo Arregui Date: Wed, 17 May 2023 13:49:17 -0300 Subject: [PATCH] chore: dereference whole API on importing to avoid extra definitions --- packages/orval/src/import-specs.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/orval/src/import-specs.ts b/packages/orval/src/import-specs.ts index 0458aa50e..ee10b90a2 100644 --- a/packages/orval/src/import-specs.ts +++ b/packages/orval/src/import-specs.ts @@ -35,16 +35,8 @@ const resolveSpecs = async ( } } - const data = (await SwaggerParser.resolve(path, options)).values(); - - if (isUrl) { - return data; - } - - // normalizing slashes after SwaggerParser - return Object.fromEntries( - Object.entries(data).map(([key, value]) => [upath.resolve(key), value]), - ); + const data = await SwaggerParser.dereference(path, options); + return { [path]: data }; } catch { const file = await fs.readFile(path, 'utf8');