Merge pull request #28151 from mbohlool/master

Automatic merge from submit-queue

Represent unversioned.Time correctly in swagger spec

unversioned.Time previously represented as "string" type with no format while the correct representation should also have "date-time" as format. fixes #2968
This commit is contained in:
k8s-merge-robot
2016-07-07 09:53:25 -07:00
committed by GitHub
24 changed files with 134 additions and 81 deletions

View File

@@ -900,6 +900,13 @@ func (s *GenericAPIServer) InstallSwaggerAPI() {
ApiPath: "/swaggerapi/",
SwaggerPath: "/swaggerui/",
SwaggerFilePath: "/swagger-ui/",
SchemaFormatHandler: func(typeName string) string {
switch typeName {
case "unversioned.Time", "*unversioned.Time":
return "date-time"
}
return ""
},
}
swagger.RegisterSwaggerService(swaggerConfig, s.HandlerContainer)
}