removed schema realms, fixed fixture generations, added dynamic type resolution for validation based on type and kind discriminators for filters
This commit is contained in:
@ -12,7 +12,10 @@ impl Schema {
|
||||
let mut strategy = String::new();
|
||||
|
||||
if let Some(family) = &self.obj.family {
|
||||
// Formalize the <Variant>.<Base> topology
|
||||
// family_base extracts the 'Base' (e.g. 'widget', 'person')
|
||||
let family_base = family.split('.').next_back().unwrap_or(family).to_string();
|
||||
// family_prefix extracts the 'Variant' (e.g. 'stock', 'light')
|
||||
let family_prefix = family
|
||||
.strip_suffix(&family_base)
|
||||
.unwrap_or("")
|
||||
@ -29,7 +32,7 @@ impl Schema {
|
||||
format!("{}.{}", family_prefix, var)
|
||||
};
|
||||
|
||||
if db.get_scoped_schema(crate::database::realm::SchemaRealm::Type, &target_id).is_some() {
|
||||
if db.schemas.get(&target_id).is_some() {
|
||||
options.insert(var.to_string(), (None, Some(target_id)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user