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

JSONValidator校验错误 <version>1.2.74</version> #3516

Closed
cdwxw opened this issue Nov 4, 2020 · 1 comment
Closed

JSONValidator校验错误 <version>1.2.74</version> #3516

cdwxw opened this issue Nov 4, 2020 · 1 comment
Milestone

Comments

@cdwxw
Copy link

cdwxw commented Nov 4, 2020

@Test
public void testCap1Case80() {
    JSONValidator jsv = JSONValidator.from("{\"cat\":\"dog\"\"cat\":\"dog\"}");
    System.out.println(jsv.validate()); // true


    JSONValidator validator = JSONValidator.from("{}");
    // 注意:必须先调用validate(),后调用getType(),因为getType()方法中执行过validate()影响结果
    System.out.println(validator.getType()); // Object
    System.out.println(validator.validate()); // false
}
@cdwxw cdwxw changed the title JSONValidator校验错误 JSONValidator校验错误 <version>1.2.74</version> Nov 4, 2020
@wenshao wenshao added this to the 1.2.75 milestone Nov 4, 2020
@wenshao wenshao closed this as completed in ab13b03 Nov 5, 2020
@cdwxw
Copy link
Author

cdwxw commented Nov 6, 2020

@wenshao 某些场景JSONValidator返回结果还是不对

    JSONValidator jsv = JSONValidator.from("{\"cat\":\"dog\"\"cat\":\"dog\"}"); // 字段之间缺英文逗号,不是json
    System.out.println(jsv.getType()); // Object
    System.out.println(jsv.validate()); // true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants