@@ -5,6 +5,45 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8+ ## [ 1.9.0] - 2024-12-19
9+
10+ ### Added
11+ - ** Native JSON Serialization Support** : Added automatic JSON serialization/deserialization for ` Hex ` type
12+ - ** HexJsonConverter** : System.Text.Json converter for seamless ` Hex ` property handling in DTOs
13+ - ** NullableHexJsonConverter** : Support for nullable ` Hex? ` properties in JSON serialization
14+ - ** JsonSerializerOptionsExtensions** : Easy configuration with ` ConfigureForHex() ` extension method
15+ - ** Comprehensive Test Coverage** : 36 new tests covering all serialization scenarios and edge cases
16+
17+ ### Changed
18+ - ** Storage DTOs Enhancement** : Consumers can now use ` Hex ` properties directly in storage DTOs without manual conversion
19+ - ** Developer Experience** : Simplified JSON API development with automatic hex string handling
20+
21+ ### Technical Details
22+ - Hex values serialize to/from hex strings (e.g., "0x1234abcd") in JSON automatically
23+ - Supports both direct ` Hex ` properties and nullable ` Hex? ` properties
24+ - Provides clear error messages for invalid hex strings during deserialization
25+ - Maintains backward compatibility - no breaking changes to existing APIs
26+ - Easy setup: single ` ConfigureForHex() ` call enables all functionality
27+
28+ ### Usage Examples
29+ ``` csharp
30+ // Configure JSON options (one-time setup)
31+ var options = new JsonSerializerOptions ().ConfigureForHex ();
32+
33+ // Use Hex properties naturally in DTOs
34+ public class TransactionDto
35+ {
36+ public Hex Hash { get ; set ; }
37+ public Hex From { get ; set ; }
38+ public Hex ? BlockHash { get ; set ; } // Nullable support
39+ }
40+
41+ // Serialization/deserialization works automatically
42+ var dto = new TransactionDto { Hash = " 0x1234abcd" }; // String assignment
43+ string json = JsonSerializer .Serialize (dto , options ); // Automatic
44+ var result = JsonSerializer .Deserialize <TransactionDto >(json , options ); // Automatic
45+ ```
46+
847## [ 1.8.0] - 2024-12-19
948
1049### Added
0 commit comments