You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes kube Schema conversion since schemars Schema's have changed.
- Add tests for a variety of enum use-cases:
- Tagged vs Untagged
- Unit vs Tuple vs Structural variants
- With and without doc-comments (descriptions)
- Rewrite the hoisting logic
- This is annotated with dev-comments to help understand intend and to ease future schemars changes.
This also fixes other issues:
- Untagged enum variant doc-comments were being applied to field descriptions.
- Additional `null` entry added to enums.
---------
Co-authored-by: Nick Larsen <[email protected]>
Co-authored-by: Sebastian Bernauer <[email protected]>
Co-authored-by: Techassi <[email protected]>
Signed-off-by: Nick Larsen <[email protected]>
panic!("Enum variant set {variant_enum_values:?} has type {variant_type:?} but was already defined as {instance_type:?}. The instance type must be equal for all subschema variants.")
330
-
}
331
-
}
332
-
}
333
-
}
334
-
common_enum_values
335
-
.get_or_insert_with(Vec::new)
336
-
.extend(variant_enum_values.iter().cloned());
337
-
false
338
-
}else{
339
-
true
340
-
}
341
-
})
342
-
}
343
-
344
-
/// Bring all property definitions from subschemas up to the root schema,
345
-
/// since Kubernetes doesn't allow subschemas to define properties.
panic!("Property {:?} has the schema {:?} but was already defined as {:?} in another subschema. The schemas for a property used in multiple subschemas must be identical",
385
-
entry.key(),
386
-
&property,
387
-
entry.get());
388
-
}
389
-
}
390
-
}
391
-
}
392
-
393
-
// Kubernetes doesn't allow variants to set additionalProperties
0 commit comments