diff --git a/src/index.ts b/src/index.ts index 3c5b9d2..539b465 100644 --- a/src/index.ts +++ b/src/index.ts @@ -84,9 +84,7 @@ export default async function bundle(files: string[], options: any = {}) { let resolvedJsons; if (majorVersion === 3) { - resolvedJsons = await resolveV3Document(parsedJsons, { - referenceIntoComponents: options.referenceIntoComponents - }); + resolvedJsons = await resolveV3Document(parsedJsons); } else { /** * Bundle all external references for each file. diff --git a/src/v3/parser.ts b/src/v3/parser.ts index c7f92e7..9a6b2aa 100644 --- a/src/v3/parser.ts +++ b/src/v3/parser.ts @@ -72,7 +72,7 @@ async function resolveExternalRefsForOperation(parsedJSON: any, $refs: $Refs) { if (isExternalReference(ref)) { const value: any = $refs.get(ref); const component = new ExternalComponents(ref, value); - parent[parentProperty]['$ref'] = `#/components/messages/${component.getKey()}`; + parent[String(parentProperty)]['$ref'] = `#/components/messages/${component.getKey()}`; } }); } @@ -95,7 +95,7 @@ export async function parse(JSONSchema: any) { } } -export async function resolveV3Document(asyncapiDocuments: AsyncAPIObject[], options: any) { +export async function resolveV3Document(asyncapiDocuments: AsyncAPIObject[]) { const docs = []; for (const asyncapiDocument of asyncapiDocuments) { await parse(asyncapiDocument);