Skip to content

Object Serialization is here!

Choose a tag to compare

@M0n7y5 M0n7y5 released this 30 Jan 12:10
· 37 commits to master since this release

New Features

Compile-Time Reflection Serialization

  • Added Json.Serialize<T>() and Json.Deserialize<T>() methods using comptime reflection
  • Support for nested objects, collections, enums, and custom attributes
  • New attributes: [JsonConverter], [JsonNumberHandling], [JsonInclude]

Pretty-Print for Comptime Serializers

  • IJsonSerializable now supports JsonWriterOptions for indented output
  • New Json.Serialize<T>(T value, Stream stream, JsonWriterOptions options) overloads

Custom Converter Support

  • Added IJsonConverter interface for custom type serialization
  • Use [JsonConverter(typeof(MyConverter))] attribute

Inheritance Support

  • Serialization/deserialization now handles inherited fields
  • Enum number handling via [JsonNumberHandling] attribute

Small String Optimization (SSO)

  • Strings <=14 characters now use stack allocation, reducing heap pressure

Improved Safe Access

  • Generic GetOrDefault<T>() overloads to avoid allocation for primitive defaults

Bug Fixes

  • Fixed memory leak in Json.Deserialize<T>()
  • Fixed null termination in dtoa function
  • Removed unused GetTypeName() method from JsonPointer

Improvements

  • Improved comment parsing error message: "// or /* to start comment"
  • New TestRelease build configuration with optimized flags
  • Updated examples and documentation

Full Changelog: v1.1.0...v1.2.0