mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +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) {
|
||||
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