mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 05:03:09 +00:00
Merge pull request #69803 from rfranzke/fix/metav1_duration_openapi
Add OpenAPI scheme methods for metav1.Duration
This commit is contained in:
commit
2ea5000379
@ -48,3 +48,13 @@ func (d *Duration) UnmarshalJSON(b []byte) error {
|
|||||||
func (d Duration) MarshalJSON() ([]byte, error) {
|
func (d Duration) MarshalJSON() ([]byte, error) {
|
||||||
return json.Marshal(d.Duration.String())
|
return json.Marshal(d.Duration.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OpenAPISchemaType is used by the kube-openapi generator when constructing
|
||||||
|
// the OpenAPI spec of this type.
|
||||||
|
//
|
||||||
|
// See: https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators
|
||||||
|
func (_ Duration) OpenAPISchemaType() []string { return []string{"string"} }
|
||||||
|
|
||||||
|
// OpenAPISchemaFormat is used by the kube-openapi generator when constructing
|
||||||
|
// the OpenAPI spec of this type.
|
||||||
|
func (_ Duration) OpenAPISchemaFormat() string { return "" }
|
||||||
|
Loading…
Reference in New Issue
Block a user