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

feat: add AVRO schema validation #347

Merged

Conversation

jonaslagoni
Copy link
Member

Description
This PR adds AVRO validation for message payloads that uses the schema formats:

"application/vnd.apache.avro;version=1.9.0",
"application/vnd.apache.avro+json;version=1.9.0",
"application/vnd.apache.avro+yaml;version=1.9.0"

Based on the recommended schema formats: https://www.asyncapi.com/docs/reference/specification/v2.6.0#messageObjectSchemaFormatTable

Related issue(s)
Blocked by #334

@jonaslagoni
Copy link
Member Author

jonaslagoni commented Mar 13, 2023

This PR is ready to be reviewed as #334 has been merged.

Think you have to re-run the macos test as it runs fine locally.

@jonaslagoni
Copy link
Member Author

See #350

@@ -0,0 +1,317 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

Out of curiosity, where did you get this schema from? https://json.schemastore.org/avro-avsc.json ? I couldn't see where it says it is 1.9 and not 1.10 or similar, that's why asking.

Copy link
Member Author

@jonaslagoni jonaslagoni Mar 13, 2023

Choose a reason for hiding this comment

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

I did yea.

I am not 100% sure it contains the exact version, but because the AsyncAPI example is valid, I did not look further into it 😄

Copy link
Member

Choose a reason for hiding this comment

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

So we are "maybe" giving support to Avro > 9. We recommend Avro 9 in our docs, but not sure it is a strong req.

Copy link
Member

Choose a reason for hiding this comment

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

@dalelane as you are more into Avro world, do you think this is important?

dalelane
dalelane previously approved these changes Mar 13, 2023
@sonarqubecloud
Copy link

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

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.

Even though #347 (comment),

LGTM!

@jonaslagoni
Copy link
Member Author

/rtm

@asyncapi-bot asyncapi-bot merged commit 488cf6b into asyncapi:next-major-spec Mar 15, 2023
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 5.0.0-next-major-spec.17 🎉

The release is available on:

Your semantic-release bot 📦🚀

@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 6.0.0-next-major-spec.1 🎉

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.

4 participants