Skip to content

Commit

Permalink
Add OpenAPI scheme methods for metav1.Duration
Browse files Browse the repository at this point in the history
  • Loading branch information
rfranzke committed Dec 6, 2018
1 parent 0351853 commit 712cbc5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/duration.go
Expand Up @@ -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 "" }

0 comments on commit 712cbc5

Please sign in to comment.