Skip to content

Commit e0d574c

Browse files
author
travis
committed
feat: add enhanced JsonSon class with validation, path-based access and API pattern support
1 parent 3c7619b commit e0d574c

14 files changed

+3247
-5
lines changed

.DS_Store

8 KB
Binary file not shown.

CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,51 @@
1+
## 0.3.3
2+
3+
- Fixed documentation comments to properly escape angle brackets in type references
4+
5+
## 0.3.2
6+
7+
### Enhanced JsonSon Class
8+
- Added error tracking with detailed path information for debugging and validation
9+
- Implemented advanced constructors for different data sources:
10+
- `fromApiResponse`: Handle API responses that might be strings or maps
11+
- `fromMapSafe`: Safely create JsonSon instances with error handling
12+
- Added batch operations for processing multiple keys or paths at once
13+
- Implemented fallback keys to try multiple keys in sequence until a value is found
14+
- Added transformation methods for mapping and merging JSON data
15+
- Implemented validation methods for checking required keys and paths
16+
17+
### Extensions
18+
- Created `JsonSonMapExtension` for direct access to JsonSon methods from Map objects
19+
- Developed `JsonSonApiExtension` for common API patterns including:
20+
- Pagination information extraction
21+
- Error handling with code and message extraction
22+
- User information normalization
23+
- Timestamp handling
24+
25+
### Validation Framework
26+
- Implemented `JsonSonValidator` with a fluent API for complex validation logic
27+
- Added type validation for strings, integers, booleans, etc.
28+
- Added format validation for emails, URLs, and custom patterns
29+
- Implemented range validation for numeric values and string lengths
30+
- Added support for custom validation rules
31+
- Added nested validation for objects and array items
32+
33+
### Testing
34+
- Added comprehensive test suite for all new features
35+
- Created tests for extensions and the validation framework
36+
- Ensured all tests pass with proper error handling
37+
38+
### Documentation
39+
- Updated README with detailed examples and API documentation
40+
- Added code examples for all new features
41+
- Provided comprehensive API reference for all classes
42+
43+
## 0.2.0
44+
45+
- Added new class-based API with `JsonSon` class for more fluent and powerful JSON handling
46+
- Added comprehensive example for the class-based approach
47+
- Maintained full backward compatibility with the functional approach
48+
149
## 0.1.22
250

351
- Added `flexibleMapFromJson` and `flexibleMapNotNullFromJson` functions for flexible map transformations

0 commit comments

Comments
 (0)