Skip to content

Commit 9e39ddc

Browse files
committed
fix(kube-core): Remove lingering type and description fields from variants without fields
Signed-off-by: Nick Larsen <nick.larsen@stackable.tech>
1 parent db0f254 commit 9e39ddc

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

kube-core/src/schema.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,18 @@ fn hoist_subschema_properties(
545545
variant_obj.additional_properties = None;
546546

547547
merge_metadata(instance_type, variant_type.take());
548+
} else if let Schema::Object(SchemaObject {
549+
metadata: variant_metadata,
550+
instance_type: variant_type,
551+
enum_values: None,
552+
subschemas: None,
553+
array: None,
554+
object: None,
555+
..
556+
}) = variant {
557+
// This removes the type/description from untagged variants without fields.
558+
std::mem::take(&mut *variant_type);
559+
std::mem::take(&mut *variant_metadata);
548560
}
549561
}
550562
}

0 commit comments

Comments
 (0)