Merge pull request #13604 from jwhonce/issues/12804

Update swagger to improve compatibility
This commit is contained in:
OpenShift Merge Robot
2022-03-23 01:27:15 +01:00
committed by GitHub
5 changed files with 23 additions and 5 deletions

View File

@ -242,7 +242,7 @@ func CreateNetwork(w http.ResponseWriter, r *http.Request) {
body := struct {
ID string `json:"Id"`
Warning []string
Warning string
}{
ID: newNetwork.ID,
}

View File

@ -169,7 +169,7 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
// - application/json
// responses:
// 200:
// description: no error
// $ref: "#/responses/InspectExecSession"
// 404:
// $ref: "#/responses/NoSuchExecInstance"
// 500:

View File

@ -105,8 +105,15 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// schema:
// $ref: "#/definitions/NetworkCreateRequest"
// responses:
// 200:
// $ref: "#/responses/CompatNetworkCreate"
// 201:
// description: network created
// schema:
// type: object
// properties:
// Id:
// type: string
// Warning:
// type: string
// 400:
// $ref: "#/responses/BadParamError"
// 500:

View File

@ -235,3 +235,12 @@ type swagSystemAuthResponse struct {
entities.AuthReport
}
}
// Inspect response
// swagger:response InspectExecSession
type swagInspectExecSession struct {
// in:body
Body struct {
define.InspectExecSession
}
}

View File

@ -20,7 +20,7 @@ type Volume struct {
}
type Report struct {
Id []string //nolint
Id []string // nolint
Err map[string]error
}
@ -98,8 +98,10 @@ type EventsOptions struct {
// ContainerCreateResponse is the response struct for creating a container
type ContainerCreateResponse struct {
// ID of the container created
// required: true
ID string `json:"Id"`
// Warnings during container creation
// required: true
Warnings []string `json:"Warnings"`
}