json_guard 4.0.0
json_guard: ^4.0.0 copied to clipboard
A library for validating, transforming, and parsing JSON data. It provides a type-safe approach to working with JSON without requiring code generation or reflection.
Changelog #
4.0.0 #
Error Handling #
- Consolidated all error types into a single
ValidationExceptionclass - Improved error messages with consistent format that includes path, value, type, and message
Standalone Validator API #
- Exposed
Validatorclass for direct use without requiring Field or Schema - Added methods to create and use validators for individual values
- Added support for chaining validators with
optional(),list(), andmap()methods
API Improvements #
- Enhanced type safety throughout the validation pipeline
- Improved error context and path tracking for nested validations
- Removed the need to finalize fields with
.field()when creating a schema
3.0.0 #
- Refactored conversion logic to improve type casting errors
- Introduced new exception types for when conversion fails due to type mismatches
2.0.0 #
RegExp fields #
- Added pattern fields with the
Field.pattern()method to convert JSON strings to RegExp objects - Added support for anchored patterns with the
fullflag to automatically add ^ and $ if not present
Map fields #
- Added support for map fields with the
map()method onFieldBuilder - Added
Field.map()factory method for creating map fields - Added
map()method toSchemaclass for processing maps of JSON objects - Renamed
many()tolist()for consistency withmap()field types
Proper casting #
- Improved type casting for all field types to allow for more flexible JSON parsing
1.0.0 #
- Initial version.