@@ -26,10 +26,10 @@ interface ServerAsyncApiMessage {
2626 description ?: string ;
2727 payload : { $ref : string } ;
2828 headers : { $ref : string } ;
29- bindings : { [ key : string ] : ServerAsyncApiMessageBinding } ;
29+ bindings : { [ protocol : string ] : ServerAsyncApiMessageBinding } ;
3030}
3131interface ServerAsyncApiMessageBinding {
32- [ key : string ] : ServerAsyncApiSchema | string ;
32+ [ protocol : string ] : ServerAsyncApiSchema | string ;
3333}
3434
3535interface ServerAsyncApiInfo {
@@ -43,7 +43,7 @@ export interface ServerAsyncApi {
4343 asyncapi : string ;
4444 info : ServerAsyncApiInfo ;
4545 servers : {
46- [ key : string ] : {
46+ [ server : string ] : {
4747 url : string ;
4848 protocol : string ;
4949 } ;
@@ -53,11 +53,11 @@ export interface ServerAsyncApi {
5353 description ?: string ;
5454 subscribe ?: {
5555 message : ServerAsyncApiChannelMessage ;
56- bindings ?: any ;
56+ bindings ?: { [ protocol : string ] : object } ;
5757 } ;
5858 publish ?: {
5959 message : ServerAsyncApiChannelMessage ;
60- bindings ?: any ;
60+ bindings ?: { [ protocol : string ] : object } ;
6161 } ;
6262 } ;
6363 } ;
@@ -157,13 +157,14 @@ export class AsyncApiMapperService {
157157 name : v . headers . $ref ,
158158 anchorUrl : AsyncApiMapperService . BASE_URL + v . headers . $ref ?. split ( '/' ) ?. pop ( )
159159 } ,
160- bindings : this . mapServerAsyncApiMessageBindings ( v . bindings )
160+ bindings : this . mapServerAsyncApiMessageBindings ( v . bindings ) ,
161+ rawBindings : v . bindings ,
161162 } ;
162163 } ) ;
163164 }
164165
165166 private mapServerAsyncApiMessageBindings (
166- serverMessageBindings ?: { [ type : string ] : ServerAsyncApiMessageBinding }
167+ serverMessageBindings ?: { [ protocol : string ] : ServerAsyncApiMessageBinding }
167168 ) : Map < string , MessageBinding > {
168169 const messageBindings = new Map < string , MessageBinding > ( ) ;
169170 if ( serverMessageBindings !== undefined ) {
@@ -190,7 +191,7 @@ export class AsyncApiMapperService {
190191 }
191192
192193
193- private mapOperation ( operationType : OperationType , message : Message , bindings ?: any ) : Operation {
194+ private mapOperation ( operationType : OperationType , message : Message , bindings ?: { [ protocol : string ] : object } ) : Operation {
194195 return {
195196 protocol : this . getProtocol ( bindings ) ,
196197 operation : operationType ,
@@ -199,7 +200,7 @@ export class AsyncApiMapperService {
199200 } ;
200201 }
201202
202- private getProtocol ( bindings ?: any ) : string {
203+ private getProtocol ( bindings ?: { [ protocol : string ] : object } ) : string {
203204 return Object . keys ( bindings ) [ 0 ] ;
204205 }
205206
0 commit comments