Skip to content

Fix: skip whitespace in empty array brackets#2596

Open
nathan-duddles wants to merge 1 commit intoajv-validator:masterfrom
nathan-duddles:fix-parse-whitespace-in-empty-array
Open

Fix: skip whitespace in empty array brackets#2596
nathan-duddles wants to merge 1 commit intoajv-validator:masterfrom
nathan-duddles:fix-parse-whitespace-in-empty-array

Conversation

@nathan-duddles
Copy link

What issue does this pull request resolve?
Fixes issue #2595

What changes did you make?
Skip whitespace before parsing items within array, because the function that parses array, parseItems, assumes that if there is whitespace then there exists items to parse.

Is there anything that requires more attention while reviewing?
This fix might also be accomplished by adding the skip whitespaces call to tryParseItems, but tryParseItems is also used by parseValues function in the same file, and it is not clear if parseValues would require the same change (while testing parsing an empty { } containing white space, the parseJson was used instead of parseValues, so I am not sure if this same bug appears in that path... I don't understand where parseValues is actually used).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant