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 + } } } }