-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
fix!: traits, id and reply problems for v3 #910
fix!: traits, id and reply problems for v3 #910
Conversation
// Normalize input to always be JSON | ||
let loadedObj; | ||
if (typeof asyncapi === 'string') { | ||
try { | ||
loadedObj = yaml.load(asyncapi); | ||
} catch (e) { | ||
loadedObj = JSON.parse(asyncapi); | ||
} | ||
} else { | ||
loadedObj = asyncapi; | ||
} | ||
// Apply unique ids before resolving references | ||
applyUniqueIds(loadedObj); |
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.
In order to apply unique IDs I had to control the input and force any input (string/yaml/json, and pure objects) to adapt them.
/rtm |
Kudos, SonarCloud Quality Gate passed! |
🎉 This PR is included in version 3.0.0-next-major-spec.15 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
This PR fixes a bunch of different edge cases with traits and ID's not being correctly created. Ontop of this, reply.messages had incorrect type as it's an array of messages NOT record, this is a breaking change.
Related issue(s)
Fixes #873
Fixes #856
Only one approach is needed, this PR or #895 for solving #873