Skip to content

Commit

Permalink
Merge branch 'canary' into fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hellovai authored Jul 3, 2024
2 parents 1efbc90 + 2755b43 commit e73bd3e
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions engine/baml-lib/baml-core/src/ir/ir_helpers/to_baml_arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,15 @@ pub fn validate_arg(
}
}
} else {
// throw an error if there are remaining fields
// instead of dropping them silently
// TODO, these extra dynamic fields should also be validated according to the runtime overrides.
// and we should also render the key by its alias.
for key in obj.keys() {
if !fields.contains_key(key) {
scope.push_error(format!(
"Unexpected field `{}` for class {}. Mark the class as @@dynamic if you want to allow additional fields.",
key, name
));
}
}
// We let it slide here... but we should probably emit a warning like this:
// for key in obj.keys() {
// if !fields.contains_key(key) {
// scope.push_error(format!(
// "Unexpected field `{}` for class {}. Mark the class as @@dynamic if you want to allow additional fields.",
// key, name
// ));
// }
// }
}

Some(BamlValue::Class(name.to_string(), fields))
Expand Down

0 comments on commit e73bd3e

Please sign in to comment.