@@ -26,10 +26,10 @@ interface ServerAsyncApiMessage {
26
26
description ?: string ;
27
27
payload : { $ref : string } ;
28
28
headers : { $ref : string } ;
29
- bindings : { [ key : string ] : ServerAsyncApiMessageBinding } ;
29
+ bindings : { [ protocol : string ] : ServerAsyncApiMessageBinding } ;
30
30
}
31
31
interface ServerAsyncApiMessageBinding {
32
- [ key : string ] : ServerAsyncApiSchema | string ;
32
+ [ protocol : string ] : ServerAsyncApiSchema | string ;
33
33
}
34
34
35
35
interface ServerAsyncApiInfo {
@@ -43,7 +43,7 @@ export interface ServerAsyncApi {
43
43
asyncapi : string ;
44
44
info : ServerAsyncApiInfo ;
45
45
servers : {
46
- [ key : string ] : {
46
+ [ server : string ] : {
47
47
url : string ;
48
48
protocol : string ;
49
49
} ;
@@ -53,11 +53,11 @@ export interface ServerAsyncApi {
53
53
description ?: string ;
54
54
subscribe ?: {
55
55
message : ServerAsyncApiChannelMessage ;
56
- bindings ?: any ;
56
+ bindings ?: { [ protocol : string ] : object } ;
57
57
} ;
58
58
publish ?: {
59
59
message : ServerAsyncApiChannelMessage ;
60
- bindings ?: any ;
60
+ bindings ?: { [ protocol : string ] : object } ;
61
61
} ;
62
62
} ;
63
63
} ;
@@ -157,13 +157,14 @@ export class AsyncApiMapperService {
157
157
name : v . headers . $ref ,
158
158
anchorUrl : AsyncApiMapperService . BASE_URL + v . headers . $ref ?. split ( '/' ) ?. pop ( )
159
159
} ,
160
- bindings : this . mapServerAsyncApiMessageBindings ( v . bindings )
160
+ bindings : this . mapServerAsyncApiMessageBindings ( v . bindings ) ,
161
+ rawBindings : v . bindings ,
161
162
} ;
162
163
} ) ;
163
164
}
164
165
165
166
private mapServerAsyncApiMessageBindings (
166
- serverMessageBindings ?: { [ type : string ] : ServerAsyncApiMessageBinding }
167
+ serverMessageBindings ?: { [ protocol : string ] : ServerAsyncApiMessageBinding }
167
168
) : Map < string , MessageBinding > {
168
169
const messageBindings = new Map < string , MessageBinding > ( ) ;
169
170
if ( serverMessageBindings !== undefined ) {
@@ -190,7 +191,7 @@ export class AsyncApiMapperService {
190
191
}
191
192
192
193
193
- private mapOperation ( operationType : OperationType , message : Message , bindings ?: any ) : Operation {
194
+ private mapOperation ( operationType : OperationType , message : Message , bindings ?: { [ protocol : string ] : object } ) : Operation {
194
195
return {
195
196
protocol : this . getProtocol ( bindings ) ,
196
197
operation : operationType ,
@@ -199,7 +200,7 @@ export class AsyncApiMapperService {
199
200
} ;
200
201
}
201
202
202
- private getProtocol ( bindings ?: any ) : string {
203
+ private getProtocol ( bindings ?: { [ protocol : string ] : object } ) : string {
203
204
return Object . keys ( bindings ) [ 0 ] ;
204
205
}
205
206
0 commit comments