-
-
Notifications
You must be signed in to change notification settings - Fork 56
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 core message payload validation #334
Merged
asyncapi-bot
merged 7 commits into
asyncapi:next-major-spec
from
jonaslagoni:feature/validate_some_message_payloads
Mar 13, 2023
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8c9f3d7
add messageObject
jonaslagoni 997328d
add validation
jonaslagoni ed2da91
Merge branch 'next-major-spec' into feature/validate_some_message_pay…
jonaslagoni 8d5c6d4
Merge branch 'next-major-spec' into feature/validate_some_message_pay…
jonaslagoni 5d098fe
fixed some problems with default message format
jonaslagoni 9f1b76f
fixed message object
jonaslagoni 44cdada
Merge branch 'next-major-spec' into feature/validate_some_message_pay…
jonaslagoni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Because there are no changes to the schema across all v2 versions and v3, I guess it makes sense to validate it against these, right?
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.
I'd say it does make sense. Better to be explicit ;]
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.
I'm concerned about having to maintain this list, add new elements per version, etc.
Can we use a pattern instead of enum here?
Maybe some change is needed. You can test it in https://www.jsonschemavalidator.net/s/VTaBCoGr
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.
Pretty sure we dont want to enable v1 or future v4 schemas here right? 🤔
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.
Also would we not want to explicitly state which schema formats are allowed as values? Using something like
v2.69.0
would not give a validation error with regex 🤔Unless you explicitly add a range, but then you are back to having to change this each version anyway.
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.
Good point.
Also thinking about new features being added between versions (no breaking changes). For example, let's say
3.1.0
introduces a new field in the schema so you will have to do a split, serving one schema for >=2.x <=3.0, and another for 3.1.Porting this to the pattern will be a bit messy. I don't like to maintain all this list but indeed i can't find a better alternative ATM but automating somehow this (we can think about in near future).