github stephenberry/glaze v2.1.2
2.1.2

latest releases: v8.4.0, v8.3.0, v8.2.0...
2 years ago

Major Feature

  • JSON Schema support for pure reflected structs
struct meta_schema_t
{
   int x{};
   std::string file_name{};
   bool is_valid{};
};

template <>
struct glz::json_schema<meta_schema_t>
{
   schema x{.description = "x is a special integer", .minimum = 1};
   schema file_name{.description = "provide a file name to load"};
   schema is_valid{.description = "for validation"};
};

struct local_schema_t
{
   int x{};
   std::string file_name{};
   bool is_valid{};

   struct glaze_json_schema
   {
      glz::schema x{.description = "x is a special integer", .minimum = 1};
      glz::schema file_name{.description = "provide a file name to load"};
      glz::schema is_valid{.description = "for validation"};
   };
};

Improvements

  • Removed corner case support of large char types incompatible with JSON by @stephenberry in #748

Full Changelog: v2.1.1...v2.1.2

Don't miss a new glaze release

NewReleases is sending notifications on new releases.