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

Add OUTERMOST_OBJ and OUTERMOST_ARR allowances #9

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,23 @@ An object that specifies what kind of partialness is allowed during JSON parsing
- `ATOM`: Allow all atomic values.
- `COLLECTION`: Allow all collection values.
- `ALL`: Allow all values.
- `OUTERMOST_OBJ`: Allow partial parsing of the outermost object.
- `OUTERMOST_ARR`: Allow partial parsing of the outermost array.

#### OUTERMOST_OBJ and OUTERMOST_ARR

These new allowances provide more granular control over parsing partial JSON:

- `OUTERMOST_OBJ`: Allows partial parsing of the outermost object in the JSON hierarchy, even if `OBJ` is not allowed.
- `OUTERMOST_ARR`: Allows partial parsing of the outermost array in the JSON hierarchy, even if `ARR` is not allowed.

The "outermost" object or array doesn't necessarily mean the root of the JSON. It refers to the highest-level object or array in the current parsing context, which doesn't have another object or array above it in the JSON hierarchy.
alanpog marked this conversation as resolved.
Show resolved Hide resolved

These allowances are particularly useful when you want to parse partial data at the highest level of your JSON structure while maintaining stricter parsing for nested objects or arrays.

For examples of how to use these allowances, please refer to the test cases in the project repository.

These new allowances provide more fine-grained control over partial JSON parsing, especially useful in scenarios where you want to be more permissive with top-level structures while maintaining stricter parsing for nested elements.
alanpog marked this conversation as resolved.
Show resolved Hide resolved

## Testing

Expand Down
Loading