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

isValidArray and JSONValidator can not valid a JSON Array #3453

Open
lyziew opened this issue Sep 19, 2020 · 0 comments
Open

isValidArray and JSONValidator can not valid a JSON Array #3453

lyziew opened this issue Sep 19, 2020 · 0 comments

Comments

@lyziew
Copy link

lyziew commented Sep 19, 2020

VERSION 1.2.73
String str = "[\n" +
" {\n" +
" "altitude": 109.0,\n" +
" "angle": 5.0,\n" +
" "index": 1,\n" +
" "type": 1\n" +
" },\n" +
" {\n" +
" "altitude": 1307.0,\n" +
" "angle": 5.0,\n" +
" "index": 2,\n" +
" "type": 1\n" +
" },\n" +
" {\n" +
" "altitude": 22.0,\n" +
" "angle": 7.0,\n" +
" "index": 3,\n" +
" "type": 1\n" +
" },\n" +
" {\n" +
" "altitude": 22.0,\n" +
" "angle": 7.0,\n" +
" "index": 4,\n" +
" "type": 2\n" +
" },\n" +
" {\n" +
" "altitude": 22.0,\n" +
" "angle": 7.0,\n" +
" "index": 5,\n" +
" "type": 2\n" +
" },\n" +
" {\n" +
" "altitude": 22.0,\n" +
" "angle": 7.0,\n" +
" "index": 6,\n" +
" "type": 2\n" +
" },\n" +
" {\n" +
" "altitude": 22.0,\n" +
" "angle": 7.0,\n" +
" "index": 7,\n" +
" "type": 2\n" +
" }\n" +
"]";
System.out.println(JSON.isValidArray(str)); // false
JSONValidator validator = JSONValidator.from(str);
validator.validate();
System.out.println(validator.getType()); // null

wenshao added a commit that referenced this issue Oct 8, 2020
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

1 participant