pub struct OptionalIntOrString;Expand description
Recursively restructures JSON Schema objects so that the Option<T> object
where T uses x-kubernetes-int-or-string is returned per k8s CRD schema expectations.
In kube 2.x with k8s-openapi 0.26.x, the schema output behavior for Option<Quantity>
and similar x-kubernetes-int-or-string types changed.
Previously given an optional Quantity field:
{ "nullable": true, "type": "string" }Now, schemars generates anyOf for Option<Quantity> like:
{
"anyOf": [
{ "x-kubernetes-int-or-string": true },
{ "enum": [null], "nullable": true }
]
}This transform converts it to:
{ "x-kubernetes-int-or-string": true, "nullable": true }Trait Implementations§
Source§impl Clone for OptionalIntOrString
impl Clone for OptionalIntOrString
Source§fn clone(&self) -> OptionalIntOrString
fn clone(&self) -> OptionalIntOrString
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OptionalIntOrString
impl Debug for OptionalIntOrString
Source§impl Default for OptionalIntOrString
impl Default for OptionalIntOrString
Source§fn default() -> OptionalIntOrString
fn default() -> OptionalIntOrString
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OptionalIntOrString
impl RefUnwindSafe for OptionalIntOrString
impl Send for OptionalIntOrString
impl Sync for OptionalIntOrString
impl Unpin for OptionalIntOrString
impl UnwindSafe for OptionalIntOrString
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more