Repository navigation
Unify JSON error paths across targets - #845
Merged
Merged
Conversation
Coverage Report for CI Build 38188800354Coverage increased (+0.001%) to 90.142%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions118 previously-covered lines in 6 files lost coverage.
Coverage Stats
💛 - Coveralls |
The targets reported different paths for the same JSON de-serialization error. For example, C++ wrote ``.someItems`` where the others wrote ``someItems``, Python wrote the keys of JSON-able objects as ``['a b']`` while the others wrote ``["a b"]``, and C++ wrote them as properties, ``.a b``. We now report the same path in all six targets: * The path starts with the first property without a dot, *e.g.*, ``items[0].name``. * A key is always written as a JSON string in brackets, *e.g.*, ``values["a b"][1]``, escaped as ``JSON.stringify`` does, so that the control characters without a short escape become ``\u00XX``. * A property name which is no identifier is written in brackets as well, *e.g.*, ``["$eq"]``, as C# and Java already did. * An unexpected property is reported at the object which holds it, while Python reported it at the unexpected property itself. * A missing, unknown or wrong model type is reported at the instance, *e.g.*, ``tricky[1]``, and a model type which is not a string at the property, ``tricky[1].modelType``, as the type errors of all the other properties are. Python now refuses a ``modelType`` on a class which carries none, as the other targets do, instead of silently accepting it. We add live test data for a model type which is not a string, and update the checked-in C++ recordings of ``json_types``.
mristin
force-pushed
the
mristin/Unify-JSON-error-paths-across-targets
branch
from
October 12, 2026 00:38
8726022 to
e3b9366
Compare
Contributor
Author
|
@chris-koo please mind this change which most probably also affects your changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The targets reported different paths for the same JSON de-serialization error. For example, C++ wrote
.someItemswhere the others wrotesomeItems, Python wrote the keys of JSON-able objects as['a b']while the others wrote["a b"], and C++ wrote them as properties,.a b. We now report the same path in all six targets:items[0].name.values["a b"][1], escaped asJSON.stringifydoes, so that the control characters without a short escape become\u00XX.["$eq"], as C# and Java already did.tricky[1], and a model type which is not a string at the property,tricky[1].modelType, as the type errors of all the other properties are.Python now refuses a
modelTypeon a class which carries none, as the other targets do, instead of silently accepting it.We add live test data for a model type which is not a string, and update the checked-in C++ recordings of
json_types.