From d608f5e9637433e62b6393d40212fd4006bee953 Mon Sep 17 00:00:00 2001 From: Satya Date: Tue, 7 Jul 2026 13:39:03 -0400 Subject: [PATCH] =?UTF-8?q?filter=20synthesis:=20omit=20Field-Backed=20JSO?= =?UTF-8?q?NB=20Bubbles=20from=20Composed=20Filter=20References=20?= =?UTF-8?q?=E2=80=94=20only=20Table-Backed=20boundaries=20have=20a=20synth?= =?UTF-8?q?esized=20.filter=20to=20proxy=20to;=20a=20dangling=20proxy=20re?= =?UTF-8?q?ference=20breaks=20downstream=20code=20generators=20consuming?= =?UTF-8?q?=20the=20exported=20registry.=20Fixture=20pins=20a=20bubble-typ?= =?UTF-8?q?ed=20property:=20omitted=20from=20the=20filter,=20raw=20schemas?= =?UTF-8?q?=20promoted,=20no=20phantom=20.filter.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fixtures/filter.json | 32 +++++++++++++++++++++++++++++++- src/database/compile/filter.rs | 12 ++++++++++-- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/fixtures/filter.json b/fixtures/filter.json index 5ce1415..8b39dfa 100644 --- a/fixtures/filter.json +++ b/fixtures/filter.json @@ -87,6 +87,34 @@ "type": "string" } } + }, + "schedule": { + "type": [ + "opening_hours", + "null" + ] + } + } + }, + "opening_hours": { + "type": "object", + "properties": { + "open": { + "type": "string" + }, + "seasons": { + "type": "array", + "items": { + "type": "season" + } + } + } + }, + "season": { + "type": "object", + "properties": { + "label": { + "type": "string" } } } @@ -483,7 +511,9 @@ ] } } - } + }, + "opening_hours": {}, + "season": {} } } } diff --git a/src/database/compile/filter.rs b/src/database/compile/filter.rs index 2474432..06e5c4d 100644 --- a/src/database/compile/filter.rs +++ b/src/database/compile/filter.rs @@ -165,8 +165,16 @@ impl Schema { } else if db.enums.contains_key(custom) { Some(vec![format!("{}.condition", custom)]) } else { - // Assume anything else is a Relational cross-boundary that already has its own .filter dynamically built - Some(vec![format!("{}.filter", custom)]) + // Only a Table-Backed boundary has a synthesized Composed Filter to proxy to. + // A Field-Backed JSONB Bubble has none — omit it like an inline object rather + // than emit a dangling proxy reference, which breaks eager consumers of the + // exported registry (downstream code generators). + let base = custom.split('.').next_back().unwrap_or(custom); + if db.types.contains_key(base) { + Some(vec![format!("{}.filter", custom)]) + } else { + None + } } } }