Skip to content
This repository was archived by the owner on Jun 18, 2023. It is now read-only.

Commit 359a880

Browse files
timonbackstavshamir
authored andcommitted
refactor: rename getAsyncApis to getAsyncApi
1 parent aac2859 commit 359a880

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

src/app/channels/channel-main/channel-main.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class ChannelMainComponent implements OnInit {
3636

3737

3838
ngOnInit(): void {
39-
this.asyncApiService.getAsyncApis().subscribe(
39+
this.asyncApiService.getAsyncApi().subscribe(
4040
asyncapi => {
4141
let schemas: Map<string, Schema> = asyncapi.components.schemas;
4242
this.schemaName = this.operation.message.payload.name.slice(this.operation.message.payload.name.lastIndexOf('/') + 1)

src/app/channels/channels.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class ChannelsComponent implements OnInit {
2121
ngOnInit(): void {
2222
this.location.subscribe((): void => this.setChannelSelectionFromLocation())
2323

24-
this.asyncApiService.getAsyncApis().subscribe(asyncapi => {
24+
this.asyncApiService.getAsyncApi().subscribe(asyncapi => {
2525
this.channels = this.sortChannels(asyncapi.channels);
2626
});
2727
}

src/app/info/info.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class InfoComponent implements OnInit {
1616
constructor(private asyncApiService: AsyncApiService) { }
1717

1818
ngOnInit(): void {
19-
this.asyncApiService.getAsyncApis().subscribe(asyncapi => {
19+
this.asyncApiService.getAsyncApi().subscribe(asyncapi => {
2020
this.asyncApiData = asyncapi;
2121
this.info = asyncapi.info;
2222
});

src/app/schemas/schemas.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class SchemasComponent implements OnInit {
2020

2121
ngOnInit(): void {
2222
this.location.subscribe(() : void => this.setSchemaSelectionFromLocation())
23-
this.asyncApiService.getAsyncApis().subscribe(asyncapi => this.schemas = asyncapi.components.schemas);
23+
this.asyncApiService.getAsyncApi().subscribe(asyncapi => this.schemas = asyncapi.components.schemas);
2424
}
2525

2626
setSchemaSelection(schema: Schema): void {

src/app/servers/servers.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class ServersComponent implements OnInit {
1414
constructor(private asyncApiService: AsyncApiService) { }
1515

1616
ngOnInit(): void {
17-
this.asyncApiService.getAsyncApis().subscribe(asyncapi => this.servers = asyncapi.servers );
17+
this.asyncApiService.getAsyncApi().subscribe(asyncapi => this.servers = asyncapi.servers );
1818
}
1919

2020
}

src/app/shared/asyncapi-mapper.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ export class AsyncApiMapperService {
120120

121121
private mapMessages(message: ServerAsyncApiChannelMessage): Message[] {
122122
if('oneOf' in message) {
123-
return this.mapServerAsyncApiMessage(message.oneOf)
123+
return this.mapServerAsyncApiMessages(message.oneOf)
124124
}
125-
return this.mapServerAsyncApiMessage([message]);
125+
return this.mapServerAsyncApiMessages([message]);
126126
}
127127

128-
private mapServerAsyncApiMessage(messages: ServerAsyncApiMessage[]): Message[] {
128+
private mapServerAsyncApiMessages(messages: ServerAsyncApiMessage[]): Message[] {
129129
return messages.map((v) => {
130130
return {
131131
name: v.name,

src/app/shared/asyncapi.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class AsyncApiService {
1414
constructor(private http: HttpClient, private asyncApiMapperService: AsyncApiMapperService) {
1515
}
1616

17-
public getAsyncApis(): Observable<AsyncApi> {
17+
public getAsyncApi(): Observable<AsyncApi> {
1818
if (this.docs) {
1919
return of(this.docs);
2020
}

0 commit comments

Comments
 (0)