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

Function walkComponents

pkg/codegen/prune.go:60–103  ·  view source on GitHub ↗
(components *openapi3.Components, doFn func(RefWrapper) (bool, error))

Source from the content-addressed store, hash-verified

58}
59
60func walkComponents(components *openapi3.Components, doFn func(RefWrapper) (bool, error)) error {
61 // Not a valid ref, ignore it and continue
62 if components == nil {
63 return nil
64 }
65
66 for _, schema := range components.Schemas {
67 _ = walkSchemaRef(schema, doFn)
68 }
69
70 for _, param := range components.Parameters {
71 _ = walkParameterRef(param, doFn)
72 }
73
74 for _, header := range components.Headers {
75 _ = walkHeaderRef(header, doFn)
76 }
77
78 for _, requestBody := range components.RequestBodies {
79 _ = walkRequestBodyRef(requestBody, doFn)
80 }
81
82 for _, response := range components.Responses {
83 _ = walkResponseRef(response, doFn)
84 }
85
86 for _, securityScheme := range components.SecuritySchemes {
87 _ = walkSecuritySchemeRef(securityScheme, doFn)
88 }
89
90 for _, example := range components.Examples {
91 _ = walkExampleRef(example, doFn)
92 }
93
94 for _, link := range components.Links {
95 _ = walkLinkRef(link, doFn)
96 }
97
98 for _, callback := range components.Callbacks {
99 _ = walkCallbackRef(callback, doFn)
100 }
101
102 return nil
103}
104
105func walkSchemaRef(ref *openapi3.SchemaRef, doFn func(RefWrapper) (bool, error)) error {
106 // Not a valid ref, ignore it and continue

Callers 1

walkSwaggerFunction · 0.85

Calls 9

walkSchemaRefFunction · 0.85
walkParameterRefFunction · 0.85
walkHeaderRefFunction · 0.85
walkRequestBodyRefFunction · 0.85
walkResponseRefFunction · 0.85
walkSecuritySchemeRefFunction · 0.85
walkExampleRefFunction · 0.85
walkLinkRefFunction · 0.85
walkCallbackRefFunction · 0.85

Tested by

no test coverage detected