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 { body := struct {
ID string `json:"Id"` ID string `json:"Id"`
Warning []string Warning string
}{ }{
ID: newNetwork.ID, ID: newNetwork.ID,
} }

View File

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

View File

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

View File

@ -235,3 +235,12 @@ type swagSystemAuthResponse struct {
entities.AuthReport 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 { type Report struct {
Id []string //nolint Id []string // nolint
Err map[string]error Err map[string]error
} }
@ -98,8 +98,10 @@ type EventsOptions struct {
// ContainerCreateResponse is the response struct for creating a container // ContainerCreateResponse is the response struct for creating a container
type ContainerCreateResponse struct { type ContainerCreateResponse struct {
// ID of the container created // ID of the container created
// required: true
ID string `json:"Id"` ID string `json:"Id"`
// Warnings during container creation // Warnings during container creation
// required: true
Warnings []string `json:"Warnings"` Warnings []string `json:"Warnings"`
} }