Skip to content
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: remove forceful normalization of YAML to JSON #1044

Conversation

aeworxet
Copy link
Contributor

This PR removes forceful normalization of YAML files to JSON format to fix #936, which in its turn lays the foundation for reporting correct range values in error diagnostics for YAML files in Studio.

Related to #1012

Copy link

changeset-bot bot commented Jul 30, 2024

🦋 Changeset detected

Latest commit: dc621f9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@asyncapi/parser Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@aeworxet aeworxet force-pushed the fix-remove-forceful-normalization-of-yaml-to-json branch from e8aaf2c to 087a11f Compare July 30, 2024 10:22
@aeworxet
Copy link
Contributor Author

@asyncapi/bounty_team

@smoya
Copy link
Member

smoya commented Jul 30, 2024

@aeworxet it would be worth adding a comment in https://github.com/asyncapi/parser-js/blob/master/packages/parser/src/validate.ts#L49 mentioning Spectral uses the https://github.com/stoplightio/yaml parser, and basically, JSON is a valid YAML doc, so no matters if you pass YAML or JSON, that YAML parser will be able to parse it.

Additionally, please add two new unit tests in for the validate method testing at least one string input for JSON and another for YAML.

@aeworxet
Copy link
Contributor Author

aeworxet commented Aug 1, 2024

Updated PR.

@aeworxet
Copy link
Contributor Author

aeworxet commented Aug 1, 2024

Credits for the pack of changes in packages/parser/test/parse.spec.ts go to eslint --fix; otherwise, Sonar complained.

Copy link
Member

@smoya smoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀🌔

Copy link

sonarcloud bot commented Aug 4, 2024

@aeworxet
Copy link
Contributor Author

aeworxet commented Aug 4, 2024

/rtm

@asyncapi-bot asyncapi-bot merged commit b700a65 into asyncapi:master Aug 4, 2024
10 checks passed
@aeworxet aeworxet deleted the fix-remove-forceful-normalization-of-yaml-to-json branch August 4, 2024 22:55
@asyncapi-bot asyncapi-bot added the bounty AsyncAPI Bounty label Aug 21, 2024
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 3.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

Inconsistent range Values in Error Diagnostics for Different AsyncAPI File Formats
3 participants