-
-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for typed array unmarshalling in TypeScript #2131
feat: add support for typed array unmarshalling in TypeScript #2131
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
✅ Deploy Preview for modelina canceled.
|
1d70296
to
86f1379
Compare
Quality Gate passedIssues Measures |
Pull Request Test Coverage Report for Build 12260990273Details
💛 - Coveralls |
@all-contributors please add @jonjomckay for code, bug, test |
I've put up a pull request to add @jonjomckay! 🎉 |
🎉 This PR is included in version 3.10.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
This PR adds support for properly unmarshalling array types, when using the TypeScript generator. Previously, the JSON array was being passed straight into the resulting object, which causes issues when using the value in another schema object and marshalling that object. The other object expects the array to contain full objects with a callable
marshal
function, not a plain object, giving an error like:Example
Given a type like this:
The generator will now generate unmarshalling code like this:
Related Issue
Checklist
npm run lint
).npm run test
).Additional Notes
The tests don't seem to pass even before my changes. I have updated the existing snapshot to cater for this change, and that test runs successfully.