v0.7.1
What's Changed
- Bump actions/checkout from 5 to 6 by @dependabot[bot] in #54
Full Changelog: v0.7.0...v0.7.1
Parent namespace invalidation support for IsValid()
IsValid() now supports parent namespaces in nested validation structures. When a nested field is invalid, all parent namespaces are automatically marked as invalid, enabling conditional checks at any level of the object graph.
What's new
- Parent namespace tracking: When a field like
"person.addresses[0].line1"is invalid, parent namespaces ("person","person.addresses","person.addresses[0]") are also marked as invalid - Improved
IsValid()behavior:IsValid()is now parent-namespace awareness - Works with all namespace types: Supports dot-separated namespaces (
In()) and indexed namespaces (InRow(),InCell())
Example
val := v.In("person",
v.InRow("addresses", 0,
v.Is(v.String("", "line1").Not().Blank()),
),
)
// Check validity at any namespace level
if !val.IsValid("person.addresses") {
// Handle address validation errors
}Benefits
- Write conditional logic at any namespace level without checking individual leaf fields
- More intuitive API for nested validation structures