Closed gabormagyar closed 2 years ago
I will take a look into this over the weekend
@gabormagyar after examining this evening, it looks like the inject helper has never been working for async api channels! Thank your for reporting it!
This resolves the issue: https://github.com/j-d-carmichael/boats/blob/2.32.0/src/Injector.ts#L254
And tested here: https://github.com/j-d-carmichael/boats/blob/2.32.0/srcASYNC2/index.yml#L19
Thanks for the quick fix!
Alternate title:
Injector
mapIndex
produces empty object for AsyncAPI documentDescribe the bug
inject([...])
filter functionality (excludeChannel
,includeOnlyChannels
) doesn't work, scope unclear.To Reproduce I'm using a standard, valid asyncAPI document, I'm not sure if it works for other things.
Expected behavior
excludeChannel
,includeOnlyChannels
params are respectedAdditional context I'm debugging into
Injector.ts
, and the offending code seems to be the mapIndex function. With this particular example at least, the problem seems to be that the$ref
field is selected twice, once by theObject.values(methods)
call, and then a second time by the explicitmethodToFileRef.$ref
accessor.You can see in the debugger that
Object.values(methods)
is already a string array:The result is that
methodToFileRef
is a string andmethodToFileRef.$ref
is undefined.Therefore nothing ever gets added to
this.this.fileToRouteMap
so nothing ever passes the filter whitelist or blacklists. They have no entries to filter against.