MCPcopy Create free account
hub / github.com/docker/docker-agent / pathOperations

Function pathOperations

pkg/tools/builtin/openapi/openapi.go:186–205  ·  view source on GitHub ↗

pathOperations returns all non-nil operations for a path item.

(item *v3.PathItem)

Source from the content-addressed store, hash-verified

184
185// pathOperations returns all non-nil operations for a path item.
186func pathOperations(item *v3.PathItem) map[string]*v3.Operation {
187 all := map[string]*v3.Operation{
188 http.MethodGet: item.Get,
189 http.MethodPost: item.Post,
190 http.MethodPut: item.Put,
191 http.MethodPatch: item.Patch,
192 http.MethodDelete: item.Delete,
193 http.MethodHead: item.Head,
194 http.MethodOptions: item.Options,
195 }
196
197 ops := make(map[string]*v3.Operation, len(all))
198 for m, op := range all {
199 if op != nil {
200 ops[m] = op
201 }
202 }
203
204 return ops
205}
206
207// resolveBaseURL determines the base URL for API requests.
208func (t *ToolSet) resolveBaseURL(spec *v3.Document) (string, error) {

Callers 1

buildToolsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected