luthor_generator 0.14.0
luthor_generator: ^0.14.0 copied to clipboard
Generate luthor schemas
0.14.0 #
-
FEAT: Add code generation support for
Map<K, V>types with automatic key and value validator generation. When a field is typed asMap<String, Comment>, the generator automatically creates validators for both the key type (String) and value type (Comment). -
FEAT: Add automatic
forwardRefdetection for self-referential types. The generator now automatically wraps schema references withforwardRef()when:- The field type directly matches the enclosing class (e.g.,
Comment? parent) - The field type is a generic containing the enclosing class (e.g.,
List<Comment>? replies,Map<String, Comment>? mentions)
This prevents stack overflow errors during schema construction for recursive data structures.
- The field type directly matches the enclosing class (e.g.,
-
FEAT: Add
@luthorForwardRefannotation support for explicit forward references. Use this annotation when you have cross-class circular references (e.g.,UserhasList<Comment>andCommenthasUser) where automatic detection isn't possible, requiring explicit annotation on the constructor parameter. -
FEAT: Add nullable type support for map key and value validators. Nullable types in
Map<K?, V?>correctly omit.required()validation when appropriate. -
FEAT: Add code generation support for
@IsUuid/@isUuid,@IsCuid/@isCuid,@IsCuid2/@isCuid2, and@IsEmoji/@isEmojiannotations. The generator now automatically generates.uuid(),.cuid(),.cuid2(), and.emoji()validation calls respectively when these annotations are used on string fields.
0.13.1 #
- FEAT: Functions passed to annotations now resolve with full qualified names. Before, if you had a function like this:
@WithCustomValidator(MyClass.customValidator)
The generated code would look like this:
.custom(customValidator)
This causes an analysis error because the function is not found. This version fixes this by resolving the function name to the full qualified name. Now, the generated code will look like this:
.custom(MyClass.customValidator)
0.13.0 #
- FEAT: Add
messageFnsupport to all validation annotations, enabling dynamic error message generation in generated schemas through top-level function references.
0.12.0 #
- FEAT: Update dependencies.
0.11.0 #
- FEAT: Add generation of type-safe
SchemaKeysconstants for schema field access with compile-time safety. - FEAT: Add support for
@WithSchemaCustomValidatorannotation to enable cross-field validation in generated schemas. - FEAT: Enhanced
ErrorKeysgeneration with improved nested field support and dot-notation access. - FEAT: Automatic JsonKey integration - SchemaKeys and ErrorKeys respect
@JsonKeyannotations for proper field mapping.
0.10.0 #
- FEAT: Add support for generating type safe error keys.
0.9.0 #
- FIX: Fix nullable DateTime handling in auto-generated schemas. Nullable DateTime fields now properly validate without requiring @luthor annotation.
0.8.0 #
- FEAT: Add auto-generation support for classes without @luthor annotation. Compatible classes (with fromJson constructor or @MappableClass annotation and named parameters) are now automatically discovered and schemas are generated for them when referenced in @luthor classes.
0.7.2 #
- FIX: Add support for nullable types and custom types in list validations. Lists can now contain nullable primitives (e.g.,
List<String?>) and custom objects with@luthorannotations (e.g.,List<MyClass>).
0.7.1 #
Note: This release has breaking changes.
- FIX: failedMessage not set is value is not a Map for SchemaValidation (#108).
0.7.0 #
Note: This release has breaking changes.
- BREAKING FEAT(luthor_generator): Add support for Freezed 3.0 (#106).
0.6.3 #
- FIX: Nullable ? in generated code.
0.5.1 #
- FEAT: Updated dependencies.
0.4.4+1 #
- Update a dependency to the latest release.
0.4.3 #
- FIX(luthor_generator): invalid identifier.
- FEAT(luthor_generator): remove validate method (#78).
- FEAT(luthor_generator): remove need for validate method.
0.4.2 #
- FEAT(luthor_generator): remove need for validate method.
- FEAT: deprecate luthor_annotation (#77).
0.4.0+1 #
0.4.0 #
0.3.2 #
- FEAT: update analyzer.
0.3.1 #
- FEAT(luthor_generator): add support for DateTime.
0.3.0 #
- FEAT(luthor_generator): validate method generates unique methods allowing multiple luthor classes in one file.
0.2.4 #
- FIX: dependencies.
- FIX(luthor): SchemaValidation null error due to covariant.
- FEAT(luthor_generator): Add support for JsonKey.name.
- FEAT(luthor_generator): luthor classes now require a validate method instead of exposing the raw schema.
- FEAT(luthor): add fromJson argument to validateSchema.
0.2.3 #
- FIX: dependencies.
- FIX(luthor): SchemaValidation null error due to covariant.
- FEAT(luthor_generator): luthor classes now require a validate method instead of exposing the raw schema.
- FEAT(luthor): add fromJson argument to validateSchema.
0.2.2 #
- Update
luthor_annotationdependency to^0.2.1
0.2.0 #
- Minimum Dart SDK version is now 3.0.0
- Luthor classes now require a validate method to be defined instead of exposing a
schemavariable. The schema is still globally accessible via$<name_of_class>Schema luthor_generatorwill validate the newvalidatemethod. If it doesn't match, it will give you the code to copy/paste in your class in the error message.
0.1.1+2 #
- Update
luthor_annotationversion in pubspec.yaml
0.1.1+1 #
- Change collect to
^1.17.0to make it compatible with Flutter 3.7
0.1.1 #
- Update README example
0.1.0 #
- [Breaking change]
schemafield is required on class with@luthorannotation - Add support for nested schemas
0.0.1 #
- Initial version.