diff --git a/src/models/v2/asyncapi.ts b/src/models/v2/asyncapi.ts index 5c1359c9e..c7329c1b6 100644 --- a/src/models/v2/asyncapi.ts +++ b/src/models/v2/asyncapi.ts @@ -97,7 +97,7 @@ export class AsyncAPIDocument extends BaseModel implements As } allServers(): ServersInterface { - const servers: ServerInterface[] = this.servers(); + const servers: ServerInterface[] = this.servers().all(); this.components().servers().forEach(server => !servers.some(s => s.json() === server.json()) && servers.push(server) ); @@ -105,7 +105,7 @@ export class AsyncAPIDocument extends BaseModel implements As } allChannels(): ChannelsInterface { - const channels: ChannelInterface[] = this.channels(); + const channels: ChannelInterface[] = this.channels().all(); this.components().channels().forEach(channel => !channels.some(c => c.json() === channel.json()) && channels.push(channel) ); diff --git a/src/models/v3/asyncapi.ts b/src/models/v3/asyncapi.ts index 40f7dbf4f..651c4583d 100644 --- a/src/models/v3/asyncapi.ts +++ b/src/models/v3/asyncapi.ts @@ -106,7 +106,7 @@ export class AsyncAPIDocument extends BaseModel implements As } allServers(): ServersInterface { - const servers: ServerInterface[] = this.servers(); + const servers: ServerInterface[] = this.servers().all(); this.components().servers().forEach(server => !servers.some(s => s.json() === server.json()) && servers.push(server) ); @@ -114,7 +114,7 @@ export class AsyncAPIDocument extends BaseModel implements As } allChannels(): ChannelsInterface { - const channels: ChannelInterface[] = this.channels(); + const channels: ChannelInterface[] = this.channels().all(); this.components().channels().forEach(channel => !channels.some(c => c.json() === channel.json()) && channels.push(channel) );