Skip to content

fix!: traits, id and reply problems for v3 - #910

Merged
asyncapi-bot merged 7 commits into
asyncapi:next-major-specfrom
jonaslagoni:fix_operation_traits
Nov 29, 2023
Merged

asyncapi-bot merged 7 commits into
asyncapi:next-major-specfrom
jonaslagoni:fix_operation_traits

Conversation

@jonaslagoni

@jonaslagoni jonaslagoni commented Nov 24, 2023 •

Copy link
Copy Markdown
Member

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

@jonaslagoni jonaslagoni changed the title fix: add test fix: traits and id problems for v3 Nov 27, 2023
Comment thread src/parse.ts
Comment on lines +47 to +59
// 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);

Copy link
Copy Markdown
Member Author

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.

@jonaslagoni
jonaslagoni marked this pull request as ready for review November 28, 2023 07:40
@jonaslagoni jonaslagoni changed the title fix: traits and id problems for v3 fix: traits, id and reply problems for v3 Nov 28, 2023
@jonaslagoni jonaslagoni changed the title fix: traits, id and reply problems for v3 fix!: traits, id and reply problems for v3 Nov 28, 2023
@jonaslagoni

Copy link
Copy Markdown
Member Author

/rtm

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@asyncapi-bot
asyncapi-bot merged commit 18ee6fe into asyncapi:next-major-spec Nov 29, 2023
@asyncapi-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.0.0-next-major-spec.15 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants