[PR #6355] Introduce JsonUtilsNew as documented in #5875 #26666

Open
opened 2026-01-31 09:17:27 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/6355

State: closed
Merged: Yes


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.

Refs #2550

**Original Pull Request:** https://github.com/microsoft/terminal/pull/6355 **State:** closed **Merged:** Yes --- 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
claunia added the pull-request label 2026-01-31 09:17:27 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26666