dart_easy_json 0.8.1
dart_easy_json: ^0.8.1 copied to clipboard
Ferramenta para facilitar a (de)serialização de objetos JSON.
0.8.1 #
- FIX: Fixed static analysis lint issues (
curly_braces_in_flow_control_structures) inuint8list_strategy.dartto achieve full 50/50 on static analysis. - CHORE: Updated
analyzerdependency constraint from^8.1.1to>=8.1.1 <15.0.0to support the latest stable version and achieve full 40/40 on up-to-date dependencies. - GOAL: Achieve 160/160 pub points on pub.dev.
0.8.0 #
- FEAT: Added
@EasyUnionannotation for Polymorphic JSON Serialization. Supports seamless serialization and deserialization of sealed classes/abstract interfaces based on a discriminator field. - FEAT: Support for union type fallbacks. Unknown union types can optionally fallback to a default type without throwing exceptions during validation.
0.7.0 #
- FEAT: Added native support for
Uint8List(Binary Data).easy_jsonnow automatically serializes/deserializesUint8Listfields to/from Base64 strings. - FEAT: Added
fromJsonandtoJsonflags to the@EasyJsonannotation to support read-only (API responses) and write-only (API requests) models, avoiding dead code generation. - REFACTOR: Removed the
flutterSDK dependency. The package is now a pure Dart package, enabling usage in CLI, server-side, and other non-Flutter Dart environments. - I18N: Standardized all fallback and hardcoded error messages to English.
- CHORE: Fixed
analyzerexperimental member use warnings in the code generator.
0.6.0 #
- FEAT: Added support for class inheritance. The
EasyJsongenerator now navigates through superclasses to automatically detect and include inherited fields in the serialization methods. - FEAT: Added support for the
@overridepattern on parent variables, allowing custom annotations like@EasyKeyor@EasyValidateto be applied to inherited fields.
0.5.0 #
- FEAT: Added
@EasyIgnoreannotation to exclude specific fields from serialization and deserialization. - FEAT: Added
@EasyPathannotation to map fields directly to nested JSON keys (e.g.,client.address.city), eliminating the need for intermediate classes. - FIX: Updated
fromJsonSafevalidation logic to correctly report errors for missing or invalid fields located at nested paths defined by@EasyPath.
0.4.2 #
- FIX: Enhanced
fromJsonSafegeneration strategy for fields using@EasyConvert.- Now implements a smart fallback mechanism: if the custom converter throws an exception (e.g., strict type mismatch), the generator attempts to use the library's native robust parsing logic (supporting ISO-8601 for DateTime, numeric coercion, etc.) before reverting to the default fallback value.
- This ensures that valid data (like an ISO String) is not discarded even if the custom converter (e.g.,
TmDateMs) strictly expects anint.
0.4.1 #
- DOCS: Significantly improved and corrected the
README.mdfile with clearer instructions, accurate configuration examples, and better explanations of all features.
0.4.0 #
- FEAT: Added
@EasyValidateannotation for powerful, declarative validation.- Supports
minLength,maxLengthfor Strings and Collections. - Supports
min,maxfor numbers. - Supports
regexfor custom string patterns. - Supports pre-defined
formatvalidation foremail,url, anduuid. - Supports
DateTimevalidation withpastandfuturechecks. - Supports
customvalidation with user-defined functions for maximum flexibility.
- Supports
- I18N: All default validation and error messages are now in English, making the library more universal.
- FIX: The code generator now correctly resolves and imports custom validators, enums, and converters defined in separate files.
0.3.0 #
- FEAT: The generator now respects the
build_extensionsconfiguration defined inbuild.yaml. This allows users to customize the output directory for generated files (e.g.,lib/generated/), and theimports in the.easy.dartfiles will be created correctly, pointing to the configured location. - DOCS: Added a section to
README.mdexplaining how to exclude generated files from static analysis inanalysis_options.yaml, improving the developer experience.
0.2.0 #
- Initial version of the package with the main features of serialization, safe deserialization, and validation.