more tests

This commit is contained in:
2026-04-10 01:06:02 -04:00
parent 3cca5ef2d5
commit be78af1507
11 changed files with 1081 additions and 965 deletions

View File

@ -120,7 +120,7 @@ impl<'a> ValidationContext<'a> {
if let Some(target_id) = options.get(val) {
if let Some(target_schema) = self.db.schemas.get(target_id) {
let derived = self.derive_for_schema(target_schema, false);
let derived = self.derive_for_schema(target_schema.as_ref(), false);
let sub_res = derived.validate()?;
let is_valid = sub_res.is_valid();
result.merge(sub_res);
@ -173,17 +173,17 @@ impl<'a> ValidationContext<'a> {
let mut custom_types = Vec::new();
match &self.schema.type_ {
Some(crate::database::schema::SchemaTypeOrArray::Single(t)) => {
if !crate::database::schema::is_primitive_type(t) {
Some(crate::database::object::SchemaTypeOrArray::Single(t)) => {
if !crate::database::object::is_primitive_type(t) {
custom_types.push(t.clone());
}
}
Some(crate::database::schema::SchemaTypeOrArray::Multiple(arr)) => {
Some(crate::database::object::SchemaTypeOrArray::Multiple(arr)) => {
if arr.contains(&payload_primitive.to_string()) || (payload_primitive == "integer" && arr.contains(&"number".to_string())) {
// It natively matched a primitive in the array options, skip forcing custom proxy fallback
} else {
for t in arr {
if !crate::database::schema::is_primitive_type(t) {
if !crate::database::object::is_primitive_type(t) {
custom_types.push(t.clone());
}
}