MCPcopy Index your code
hub / github.com/oapi-codegen/oapi-codegen / walkSwagger

Function walkSwagger

pkg/codegen/prune.go:16–33  ·  view source on GitHub ↗
(swagger *openapi3.T, doFn func(RefWrapper) (bool, error))

Source from the content-addressed store, hash-verified

14}
15
16func walkSwagger(swagger *openapi3.T, doFn func(RefWrapper) (bool, error)) error {
17 if swagger == nil || swagger.Paths == nil {
18 return nil
19 }
20
21 for _, p := range swagger.Paths.Map() {
22 for _, param := range p.Parameters {
23 _ = walkParameterRef(param, doFn)
24 }
25 for _, op := range p.Operations() {
26 _ = walkOperation(op, doFn)
27 }
28 }
29
30 _ = walkComponents(swagger.Components, doFn)
31
32 return nil
33}
34
35func walkOperation(op *openapi3.Operation, doFn func(RefWrapper) (bool, error)) error {
36 // Not a valid ref, ignore it and continue

Callers 1

findComponentRefsFunction · 0.85

Calls 3

walkParameterRefFunction · 0.85
walkOperationFunction · 0.85
walkComponentsFunction · 0.85

Tested by

no test coverage detected