mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
Return error when schema definitions collide
This commit is contained in:
@@ -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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user