Skip to content

Commit

Permalink
Introduce JsonUtilsNew as documented in #5875 (#6355)
Browse files Browse the repository at this point in the history
Read the [JsonUtils Spec] for more details.

This pull request introduces the next version of JsonUtils. It is in a
separate file for ease of review and testing.

JsonUtilsNew will be renamed in a subsequent commit that rewrites our
JSON deserializers.

### Implementer's Notes

I went with telescoping exceptions for the key parsing code, because
it's totally possible that you can be five keys deep and encounter a
type error. This lets us encode information about all failures in the
chain instead of just the topmost one.

The original JsonUtilsNew code changed to use `decay` everywhere because
the tests wouldn't compile. We want to treat `GetValue<const guid>` _the
same as_ `GetValue<guid>`, and this lets us do so. `decay` is awesome.

I've been developing this with a shim that redirects `JsonUtils.h` to
`JsonUtilsNew.h`. I am not comfortable deleting the original until we've
moved off of it, and that _will_ be the subject of a followup PR.

## Validation Steps Performed

So many tests.

[JsonUtils Spec]: https://github.com/microsoft/terminal/blob/master/doc/cascadia/Json-Utility-API.md

Refs #2550
  • Loading branch information
DHowett authored Jun 18, 2020
1 parent 6485a2b commit 10bc1a6
Show file tree
Hide file tree
Showing 5 changed files with 918 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/actions/spell-check/expect/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2255,6 +2255,7 @@ targetnametoken
targetver
taskbar
tbar
TBase
tbc
tbi
Tbl
Expand Down Expand Up @@ -2297,6 +2298,7 @@ testtestabc
testtesttesttesttest
TEXCOORD
texel
TExpected
textattribute
TEXTATTRIBUTEID
Textbox
Expand All @@ -2321,6 +2323,7 @@ tilunittests
Timeline
titlebar
TITLEISLINKNAME
TJson
tl
TLEN
Tlg
Expand All @@ -2343,6 +2346,7 @@ tooltip
TOPDOWNDIB
TOPLEFT
TOPRIGHT
TOpt
tosign
touchpad
towlower
Expand Down Expand Up @@ -2385,6 +2389,7 @@ Txtev
typechecked
typechecking
typedef
typeid
typeinfo
typelib
typename
Expand Down
Loading

0 comments on commit 10bc1a6

Please sign in to comment.