We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6eb14fc commit 77af8e5Copy full SHA for 77af8e5
kube-core/src/schema/transform_one_of.rs
@@ -80,9 +80,11 @@ fn hoist_one_of_enum_with_unit_variants(kube_schema: &mut SchemaObject) {
80
Schema::Bool(_) => panic!("oneOf variants can not be of type boolean"),
81
});
82
83
- // Get the first type
+ // Get the first type...
84
let variant_type = types.next().expect("at this point, there must be a type");
85
- // Ensure all variant types match it
+ // ... and ensure all variant types match it.
86
+ // This is needed because the individual subschema enums (each with their own type field)
87
+ // will be combined into one enum with one type field.
88
if types.any(|r#type| r#type != variant_type) {
89
panic!("oneOf variants must all have the same type");
90
}
0 commit comments