New Features
C shared library interop (FFI) using Glaze and modern C++ reflection in #1890
Documentation: https://stephenberry.github.io/glaze/interop/
Key transformers in #1889
struct my_struct {
int user_id = 123;
std::string first_name = "John";
};
// Apply camelCase transformation
template <>
struct glz::meta<my_struct> : glz::camel_case {};// JSON output: {"userId":123,"firstName":"John"}
8 Naming Convention Transformers:
camel_case: snake_case → camelCase
pascal_case: snake_case → PascalCase
snake_case: camelCase/PascalCase → snake_case
screaming_snake_case: any → SCREAMING_SNAKE_CASE
kebab_case: any → kebab-case
screaming_kebab_case: any → SCREAMING-KEBAB-CASE
lower_case: any → lowercase
upper_case: any → UPPERCASE
Zero Runtime Overhead: All transformations occur at compile-time through constexpr functions
Use smallest object when encountering ambiguous variants in #1903
Previously, when multiple variant types had overlapping fields (e.g., one type being a subset of
another), Glaze would fail with error_code::no_matching_variant_type. This was particularly
problematic for common patterns like:
- Progressive detail levels (BasicInfo → DetailedInfo → FullInfo)
- Optional field patterns where simpler types are subsets of complex ones
- API versioning where newer types extend older ones
The resolution strategy:
During JSON parsing, when multiple object types in a variant match all their required fields, the type with the minimum field count is automatically selected. This ensures the most specific/appropriate type is chosen.
Improvements
- Remove unneeded CMake VS Code extension from devcontainer by @kaladron in #1893
- devcontainer version updates by @kaladron in #1894
- Update Dockerfile to use official devcontainer image by @kaladron in #1897
- Update CMakePresets.json to use system GCC and G++ compilers by @kaladron in #1899
- glz::json_t struct assignment by @stephenberry in #1902
- Add title and required to generated JSON schema by @oleid in #1850
Full Changelog: v5.5.5...v5.6.0