Skip to content

Commit 8abef36

Browse files
committed
test: Add empty object handling to existing hoisting function
Note: At this point, there is some strange interaction with the new hoisting functions and the existing code whereby "properties" disappear.
1 parent c2fbe70 commit 8abef36

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

kube-core/src/schema.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,6 @@ fn hoist_any_of_option_enum(incoming: SchemaObject) -> SchemaObject {
497497
let null = json!({
498498
"enum": [null],
499499
"nullable": true
500-
501500
});
502501

503502
// iter through any_of for matching null
@@ -692,6 +691,17 @@ fn hoist_subschema_properties(
692691
variant_obj.additional_properties = None;
693692

694693
merge_metadata(instance_type, variant_type.take());
694+
} else if let Schema::Object(SchemaObject {
695+
object: None,
696+
instance_type: variant_type,
697+
metadata,
698+
..
699+
}) = variant
700+
{
701+
if *variant_type == Some(SingleOrVec::Single(Box::new(InstanceType::Object))) {
702+
*variant_type = None;
703+
*metadata = None;
704+
}
695705
}
696706
}
697707
}

0 commit comments

Comments
 (0)