json-repair 0.54.2__tar.gz → 0.54.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {json_repair-0.54.2/src/json_repair.egg-info → json_repair-0.54.3}/PKG-INFO +1 -1
- {json_repair-0.54.2 → json_repair-0.54.3}/pyproject.toml +1 -1
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair/parse_object.py +6 -1
- {json_repair-0.54.2 → json_repair-0.54.3/src/json_repair.egg-info}/PKG-INFO +1 -1
- {json_repair-0.54.2 → json_repair-0.54.3}/tests/test_parse_object.py +4 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/LICENSE +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/README.md +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/setup.cfg +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair/__init__.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair/__main__.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair/json_parser.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair/json_repair.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair/parse_array.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair/parse_comment.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair/parse_number.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair/parse_string.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair/parse_string_helpers/parse_boolean_or_null.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair/parse_string_helpers/parse_json_llm_block.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair/py.typed +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair/utils/constants.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair/utils/json_context.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair/utils/object_comparer.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair/utils/string_file_wrapper.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair.egg-info/SOURCES.txt +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair.egg-info/dependency_links.txt +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair.egg-info/entry_points.txt +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/src/json_repair.egg-info/top_level.txt +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/tests/test_json_repair.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/tests/test_parse_array.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/tests/test_parse_comment.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/tests/test_parse_number.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/tests/test_parse_string.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/tests/test_performance.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/tests/test_repair_json_cli.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/tests/test_repair_json_from_file.py +0 -0
- {json_repair-0.54.2 → json_repair-0.54.3}/tests/test_strict_mode.py +0 -0
|
@@ -125,7 +125,12 @@ def parse_object(self: "JSONParser") -> JSONReturnType:
|
|
|
125
125
|
|
|
126
126
|
if self.get_char_at() in [",", "'", '"']:
|
|
127
127
|
self.index += 1
|
|
128
|
-
|
|
128
|
+
if self.get_char_at() == "]" and ContextValues.ARRAY in self.context.context:
|
|
129
|
+
self.log(
|
|
130
|
+
"While parsing an object we found a closing array bracket, closing the object here and rolling back the index"
|
|
131
|
+
)
|
|
132
|
+
self.index -= 1
|
|
133
|
+
break
|
|
129
134
|
# Remove trailing spaces
|
|
130
135
|
self.skip_whitespaces()
|
|
131
136
|
|
|
@@ -84,6 +84,10 @@ def test_parse_object_edge_cases():
|
|
|
84
84
|
== '{"key": "{\\"key\\":[\\"value\\"],\\"key2\\":\\"value2\\"}"}'
|
|
85
85
|
)
|
|
86
86
|
assert repair_json('{"key": , "key2": "value2"}') == '{"key": "", "key2": "value2"}'
|
|
87
|
+
assert (
|
|
88
|
+
repair_json('{"array":[{"key": "value"], "key2": "value2"}')
|
|
89
|
+
== '{"array": [{"key": "value"}], "key2": "value2"}'
|
|
90
|
+
)
|
|
87
91
|
|
|
88
92
|
|
|
89
93
|
def test_parse_object_merge_at_the_end():
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|