mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Merge pull request #113338 from apelisse/swagger-unmarshaljson
Swagger unmarshaljson
This commit is contained in:
commit
d77d28b15f
@ -22,7 +22,6 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
utiljson "k8s.io/apimachinery/pkg/util/json"
|
||||
"k8s.io/apiserver/pkg/authentication/user"
|
||||
"k8s.io/apiserver/pkg/endpoints/request"
|
||||
"k8s.io/kube-openapi/pkg/validation/spec"
|
||||
@ -79,7 +78,7 @@ func (s *Downloader) Download(handler http.Handler, etag string) (returnSpec *sp
|
||||
return nil, "", http.StatusNotFound, nil
|
||||
case http.StatusOK:
|
||||
openAPISpec := &spec.Swagger{}
|
||||
if err := utiljson.Unmarshal(writer.data, openAPISpec); err != nil {
|
||||
if err := openAPISpec.UnmarshalJSON(writer.data); err != nil {
|
||||
return nil, "", 0, err
|
||||
}
|
||||
newEtag = writer.Header().Get("Etag")
|
||||
|
Loading…
Reference in New Issue
Block a user