Return error when schema definitions collide

This commit is contained in:
Jack Mousseau
2026-03-05 10:13:01 -08:00
parent 926b2f19e8
commit 6e8785a021

View File

@@ -1154,6 +1154,14 @@ fn insert_into_namespace(
.or_insert_with(|| Value::Object(Map::new()));
match entry {
Value::Object(map) => {
if let Some(existing) = map.get(&name) {
if existing != &schema {
return Err(anyhow!(
"conflicting schema definition for {namespace}/{name}"
));
}
return Ok(());
}
map.insert(name, schema);
Ok(())
}