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

Complete strictMode for JSONArray #887

Open
stleary opened this issue Apr 13, 2024 · 3 comments
Open

Complete strictMode for JSONArray #887

stleary opened this issue Apr 13, 2024 · 3 comments

Comments

@stleary
Copy link
Owner

stleary commented Apr 13, 2024

Garbage chars at the end of JSONArray docs are still allowed in strict mode. This needs to be fixed.

Here is a list of examples of JSON text strings that should be allowed in default mode, but not in strict mode. This is not an exhaustive list. Unit tests should confirm expected behavior when strictMode is true and false.

"[]asdf",
"[]]",
"[]}",
"[][",
"[]{",
"[],",
"[]:",
"[],[",
"[],{"

Note: It should not be necessary for the code to check for specific trailing chars; strict mode is violated if parsing is completed and there are still chars left in the JSONTokener instance.

@stleary stleary changed the title Completed strictMode for JSONArray Complete strictMode for JSONArray Apr 13, 2024
@rikkarth
Copy link
Contributor

rikkarth commented Apr 14, 2024

Hi @stleary would you please be able to provide one or two examples?

@stleary
Copy link
Owner Author

stleary commented Apr 14, 2024

Description updated

@rikkarth
Copy link
Contributor

image

rikkarth added a commit to rikkarth/JSON-java-fork that referenced this issue Apr 14, 2024
rikkarth added a commit to rikkarth/JSON-java-fork that referenced this issue Apr 14, 2024
rikkarth added a commit to rikkarth/JSON-java-fork that referenced this issue Apr 21, 2024
rikkarth added a commit to rikkarth/JSON-java-fork that referenced this issue Apr 21, 2024
rikkarth added a commit to rikkarth/JSON-java-fork that referenced this issue Apr 23, 2024
rikkarth added a commit to rikkarth/JSON-java-fork that referenced this issue Apr 23, 2024
rikkarth added a commit to rikkarth/JSON-java-fork that referenced this issue Apr 23, 2024
rikkarth added a commit to rikkarth/JSON-java-fork that referenced this issue Apr 23, 2024
rikkarth added a commit to rikkarth/JSON-java-fork that referenced this issue Apr 28, 2024
- JSONArray now evaluates EOF accordingly for empty Array inputs.
- JSONTokener fixed indentation
- externalized two JSONMLTest cases
rikkarth added a commit to rikkarth/JSON-java-fork that referenced this issue Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants