feat: add support for AsyncAPI headers#2484
Open
matthew-inamdar wants to merge 5 commits intoasyncapi:masterfrom
Open
feat: add support for AsyncAPI headers#2484matthew-inamdar wants to merge 5 commits intoasyncapi:masterfrom
matthew-inamdar wants to merge 5 commits intoasyncapi:masterfrom
Conversation
❌ Deploy Preview for modelina failed.
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
This PR adds opt-in support for header schemas in AsyncAPI specifications.
The
ProcessorOptionstype now accepts a newAsyncAPIInputProcessorOptionstype for theasyncapifield.The
AsyncAPIInputProcessorOptionstype has a single boolean option forincludeMessageHeaders.When
includeMessageHeadersis set to true the following logic applies:PayloadHeadersN.B. I expect both the change in behavior for 2.i., and also the suffix naming convention to possibly be contentious and are therefore looking for guidance on these approaches.
Related Issue
#2482
Checklist
npm run lint).npm run test).Additional Notes
There is a further consideration about having a type generated for each message which is composed of headers and payload types – this would allow for discriminating once for the entire message instead of separately for both the headers and the payload.
This seems to require further changes to the behavior and I'm not confident if there is an appetite for it. If there is, I'll be happy to look into this approach.