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 使用异常 #3343

Closed
changlie opened this issue Jul 14, 2020 · 1 comment
Closed

JSONValidator 使用异常 #3343

changlie opened this issue Jul 14, 2020 · 1 comment
Milestone

Comments

@changlie
Copy link

JSONValidator.from("{"name":"999}").valiate() 直接抛异常???
JSONValidator.from("false").valiate(), JSONValidator.from("999").valiate() 直接返回true, 这个不是判断字符串是否为json字符串的吗??????

@wenshao wenshao added this to the 1.2.73 milestone Jul 14, 2020
@wenshao
Copy link
Member

wenshao commented Jul 14, 2020

       assertFalse(
                JSONValidator.from("{\"name\":\"999}")
                        .validate());
      -- 这个问题已经修复

        assertTrue(
                JSONValidator.from("false")
                        .validate());
        assertEquals(JSONValidator.Type.Value,
                JSONValidator.from("false")
                        .getType());

        assertTrue(
                JSONValidator.from("999").validate());
        assertEquals(JSONValidator.Type.Value,
                JSONValidator.from("999")
                        .getType());
      -- 这俩个是标准的JSON格式

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