SchemaMatch
zio.blocks.schema.SchemaMatch
object SchemaMatch
Provides matching logic for SchemaRepr patterns against DynamicValue instances.
This object implements structural pattern matching between schema representations and runtime dynamic values, enabling the search optic to find values that match a given schema pattern.
==Matching Rules==
- '''Wildcard''': Matches any DynamicValue
- '''Primitive(name)''': Matches DynamicValue.Primitive where the underlying PrimitiveValue type matches the name (case-insensitive)
- '''Record(fields)''': Matches DynamicValue.Record using subset matching - all specified fields must exist with matching types, but extra fields are allowed
- '''Variant(cases)''': Matches DynamicValue.Variant if the case name matches one of the pattern cases and the payload matches that case's pattern
- '''Sequence(elem)''': Matches DynamicValue.Sequence if all elements match the element pattern (empty sequence always matches)
- '''Map(k, v)''': Matches DynamicValue.Map if all entries have matching key and value types (empty map always matches)
- '''Optional(inner)''': Matches DynamicValue.Null always, otherwise checks inner pattern
- '''Nominal(name)''': Returns false (requires schema context not available in DynamicValue)
Attributes
- Source
- SchemaMatch.scala
- Graph
-
- Supertypes
- Self type
-
SchemaMatch.type
Members list
In this article