Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants