filter synthesis: named value types get their own synthesized, referenced filter

Supersedes the inline-structural approach (0d282cc): inlining erased the value
type's name, so identical nested shapes (weekly_hours at two paths) generated
duplicate leaf types downstream and Dart barrel exports collided. Now a named
non-table value type's filter is synthesized ONCE (like table-backed boundaries)
and property references point at it — mirroring how the entity side generates
one class per named type. Same filter-by-fields capability; laziness also
removes the structural-recursion hazard. A named type with no compilable
structure still gets no filter and is omitted rather than dangled.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-03 20:04:16 -04:00
parent 8aa15873b0
commit 03a871bc1a
3 changed files with 91 additions and 75 deletions

View File

@ -400,38 +400,9 @@
},
"schedule": {
"type": [
"filter",
"opening_hours.filter",
"null"
],
"compiledPropertyNames": [
"open",
"seasons"
],
"properties": {
"open": {
"type": [
"string.condition",
"null"
]
},
"seasons": {
"type": [
"filter",
"null"
],
"compiledPropertyNames": [
"label"
],
"properties": {
"label": {
"type": [
"string.condition",
"null"
]
}
}
}
}
]
}
},
"type": "filter"
@ -551,7 +522,61 @@
}
},
"opening_hours": {},
"season": {}
"season": {},
"opening_hours.filter": {
"type": "filter",
"compiledPropertyNames": [
"open",
"seasons",
"$and",
"$or"
],
"properties": {
"open": {
"type": [
"string.condition",
"null"
]
},
"seasons": {
"type": [
"season.filter",
"null"
]
},
"$and": {
"type": [
"array",
"null"
],
"items": {
"type": "opening_hours.filter",
"compiledPropertyNames": [
"open",
"seasons",
"$and",
"$or"
]
}
},
"$or": {
"type": [
"array",
"null"
],
"items": {
"type": "opening_hours.filter",
"compiledPropertyNames": [
"open",
"seasons",
"$and",
"$or"
]
}
}
}
},
"season.filter": {}
}
}
}