Skip to content

Commit e16450f

Browse files
committed
Bump version to 1.9.0 for JSON serialization release
1 parent eeb73ed commit e16450f

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,45 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and 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

src/Evoq.Blockchain/Evoq.Blockchain.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>netstandard2.1</TargetFramework>
55
<LangVersion>latest</LangVersion>
66
<Nullable>enable</Nullable>
7-
<Version>1.8.0</Version>
7+
<Version>1.9.0</Version>
88
<Authors>Luke Puplett</Authors>
99
<Company>Evoq</Company>
1010
<Description>Blockchain utilities for .NET applications</Description>

0 commit comments

Comments
 (0)