-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add Avro Schema Validation #37
Comments
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request. Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue. |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
@JQrdan did you plan to work on this. I'm not sure from the description how would you see it works. Are there some js avro validators you know that could be integrated? |
@derberg Unfortunately not. I'm not aware of any reputable Avro validators out there for JS but wanted to raise the issue to see if there were any plans/thoughts about this kind of thing given that everything else is validated 😄 |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
https://github.com/mtth/avsc looks pretty good @JQrdan - think this would cover what you had in mind? const assert = require('assert');
// npm install avsc
const avro = require('avsc');
// -------- TEST SCHEMAS -------------------------------------------
const VALID_SCHEMA = {
type : 'record',
fields : [
{ name : 'test', type : 'string' }
]
};
const INVALID_SCHEMA = {
type : 'record',
fields : [
{ name : 'test', type : 'fish' }
]
};
const NOT_EVEN_CLOSE = {
hello : 'world'
};
// -------- PARSING THE TEST SCHEMAS -------------------------------------------
const type = avro.Type.forSchema(VALID_SCHEMA);
assert(type);
try {
const type2 = avro.Type.forSchema(INVALID_SCHEMA);
assert.fail();
}
catch (err) {
assert(err);
}
try {
const type3 = avro.Type.forSchema(NOT_EVEN_CLOSE);
assert.fail();
}
catch (err) {
assert(err);
} |
This commit adds validation to the avro-schema-parser so that invalid Avro schemas will be rejected. I had to fix a few invalid Avro schemas in the tests (which were using the type 'uuid' which isn't in the Avro spec) so this should potentially be considered a major breaking change to the parser. Closes: #37 Signed-off-by: Dale Lane <[email protected]>
This commit adds validation to the avro-schema-parser so that invalid Avro schemas will be rejected. I had to fix a few invalid Avro schemas in the tests (which were using the type 'uuid' which isn't in the Avro spec) so this should potentially be considered a major breaking change to the parser. Closes: #37 Signed-off-by: Dale Lane <[email protected]>
This commit adds validation to the avro-schema-parser so that invalid Avro schemas will be rejected. I had to fix a few invalid Avro schemas in the tests (which were using the type 'uuid' which isn't in the Avro spec) so this should potentially be considered a major breaking change to the parser. Closes: #37 Signed-off-by: Dale Lane <[email protected]>
🎉 This issue has been resolved in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Reason/Context
Please try answering few of those questions
Description
Please try answering few of those questions
The text was updated successfully, but these errors were encountered: