File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -83,14 +83,13 @@ pub(crate) fn hoist_properties_for_any_of_subschemas(kube_schema: &mut SchemaObj
8383 while let Some ( ( property_name, Schema :: Object ( property_schema_object) ) ) =
8484 object. properties . pop_first ( )
8585 {
86+ let parent_object = parent_object
87+ // get the `ObjectValidation`, or an empty one without any properties set
88+ . get_or_insert_default ( ) ;
89+
8690 // This would check that the variant property (that we want to now hoist)
8791 // is exactly the same as what is already hoisted (in this function).
88- if let Some ( existing_property) = parent_object
89- // get the `ObjectValidation`, or an empty one without any properties set
90- . get_or_insert_default ( )
91- . properties
92- . get ( & property_name)
93- {
92+ if let Some ( existing_property) = parent_object. properties . get ( & property_name) {
9493 // TODO (@NickLarsenNZ): Here we could do another check to see if it only
9594 // differs by description. If the schema property description is not set, then
9695 // we could overwrite it and not panic.
@@ -102,7 +101,6 @@ pub(crate) fn hoist_properties_for_any_of_subschemas(kube_schema: &mut SchemaObj
102101 } else {
103102 // Otherwise, insert the subschema properties into the schema properties
104103 parent_object
105- . get_or_insert_default ( )
106104 . properties
107105 . insert ( property_name. clone ( ) , Schema :: Object ( property_schema_object) ) ;
108106 }
You can’t perform that action at this time.
0 commit comments