Skip to content

Conversation

michaeltlombardi
Copy link
Collaborator

@michaeltlombardi michaeltlombardi commented Oct 9, 2025

PR Summary

This change begins the schema canonicalization process by adding a new library crate to contain the helpers for defining canonical and enhanced schemas ergonomically.

In this initial phase, the new crate defines:

  • The VSCODE_KEYWORDS constant, enumerating the keywords that VS Code's JSON language server recognizes.
  • The idiomaticize_string_enum transformer for munging the generated schemas for string enums with annotation keywords.
  • The idiomaticize_externally_tagged_enum transformer for munging the generated schemas for externally tagged enums to a more idiomatic and readable representation.

This change uses the new idiomaticize_* transformers from the dsc-lib-jsonschema crate in the dsc-lib crate to ensure that the generated schemas are idiomatic.

PR Context

@michaeltlombardi michaeltlombardi force-pushed the gh-538/main/initial-canonicalization branch 3 times, most recently from f819c18 to 567daae Compare October 11, 2025 17:24
This change begins the schema canonicalization process by
adding a new library crate to contain the helpers for
defining canonical and enhanced schemas ergonomically.

In this initial phase, the new crate defines:

- The `VSCODE_KEYWORDS` constant, enumerating the keywords
  that VS Code's JSON language server recognizes.
- The `idiomaticize_string_enum` transformer for munging the
  generated schemas for string enums with annotation keywords.
- The `idiomaticize_externally_tagged_enum` transformer for
  munging the generated schemas for externally tagged enums
  to a more idiomatic and readable representation.
This change uses the new `idiomaticize_*` transformers from the
`dsc-lib-jsonschema` crate in the `dsc-lib` crate to ensure that
the generated schemas are idiomatic.
@michaeltlombardi michaeltlombardi force-pushed the gh-538/main/initial-canonicalization branch from 567daae to 2d9b276 Compare October 11, 2025 17:28
This change updates the i18n Pester tests to account for:

- Usage of the `t!` macro when the translation key is defined on the next line.
- Usage of the convenience `panic_t!` macro, which simplifies sending translated
  strings to the `panic!` macro.
- Usage of the convenience `assert_t!` macro, which simplifies sending translated
  strings to the panic when an `assert!` macro fails.

These use cases were required for the `dsc-lib-jsonschema` crate, which uses both
`panic_t!` and `assert_t!` to raise translated panic messages when a transform is
invalidly applied.

While this change doesn't modify the behavior for any other crates, it does lay the
groundwork for translating panic messages and assertions throughout the crates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant