-
Notifications
You must be signed in to change notification settings - Fork 15
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
tstr
type allows maps?
#82
Comments
Good catch, thanks for reporting @adzialocha! Fixing in #85. |
Thank you for this fast fix! |
This has been fixed as of v0.8.6. Pleas reopen if you are still experiencing issues. |
This might still be a problem @anweiss as maps are still considered valid strings in this test using version let schema = r#"
message = {
fields: {
+ tstr => tstr,
}
}
"#;
// {"fields": {"test": "Hello, Message!"}}
let correct_cbor = "A1666669656C6473A164746573746F48656C6C6F2C204D65737361676521";
// {"fields": {"test": {"Text": "Hello, Message!"}}}
let invalid_cbor = "A1666669656C6473A16474657374A164546578746F48656C6C6F2C204D65737361676521";
assert!(cddl::validate_cbor_from_slice(schema, correct_cbor.as_bytes()).is_ok());
assert!(cddl::validate_cbor_from_slice(schema, invalid_cbor.as_bytes()).is_err()); |
Hmmm ... I think you're right. Reopening to do some more troubleshooting here. Thanks for reporting. |
Hey @adzialocha this is (finally) being fixed in #79 |
Thank you for this fantastic implementation of CDDL! ✨
I've stumbled upon the following issue and wonder if it might be a bug?
The following CDDL schema (wrongly?) allows maps as values in the
fields
map even though onlytstr
types are permitted:This CBOR here (with diagnostic JSON) gets accepted by this schema while I would expect an error:
The text was updated successfully, but these errors were encountered: