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

Array type is not displayed in the error message when multiple types are present in the type validator #216

Closed
Stranger6667 opened this issue May 5, 2021 · 0 comments · Fixed by #217

Comments

@Stranger6667
Copy link
Owner

Stranger6667 commented May 5, 2021

let mut types = PrimitiveTypesBitMap::new();
types |= PrimitiveType::Null;
types |= PrimitiveType::Object;
types |= PrimitiveType::Array;
assert!(types.contains_type(PrimitiveType::Null));
assert!(types.contains_type(PrimitiveType::Object));
assert!(types.contains_type(PrimitiveType::Array));
assert_eq!(
    types.into_iter().collect::<Vec<PrimitiveType>>(),
    vec![
        PrimitiveType::Null,
        PrimitiveType::Object,
        PrimitiveType::Array
    ]
)

Fails on the last assertion. I.e. the validation is ok, but the error message is not correct

@Stranger6667 Stranger6667 changed the title Array type is not validated when multiple types are present in the type validator Some types are not validated when multiple types are present in the type validator May 5, 2021
@Stranger6667 Stranger6667 changed the title Some types are not validated when multiple types are present in the type validator Array type is not validated when multiple types are present in the type validator May 5, 2021
@Stranger6667 Stranger6667 changed the title Array type is not validated when multiple types are present in the type validator Array type is not displayed in the error message when multiple types are present in the type validator May 5, 2021
Stranger6667 added a commit that referenced this issue May 5, 2021
Stranger6667 added a commit that referenced this issue May 5, 2021
Stranger6667 added a commit that referenced this issue May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant