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

Function walkHeaderRef

pkg/codegen/prune.go:288–308  ·  view source on GitHub ↗
(ref *openapi3.HeaderRef, doFn func(RefWrapper) (bool, error))

Source from the content-addressed store, hash-verified

286}
287
288func walkHeaderRef(ref *openapi3.HeaderRef, doFn func(RefWrapper) (bool, error)) error {
289 // Not a valid ref, ignore it and continue
290 if ref == nil {
291 return nil
292 }
293 refWrapper := RefWrapper{Ref: ref.Ref, HasValue: ref.Value != nil, SourceRef: ref}
294 shouldContinue, err := doFn(refWrapper)
295 if err != nil {
296 return err
297 }
298 if !shouldContinue {
299 return nil
300 }
301 if ref.Value == nil {
302 return nil
303 }
304
305 _ = walkSchemaRef(ref.Value.Schema, doFn)
306
307 return nil
308}
309
310func walkSecuritySchemeRef(ref *openapi3.SecuritySchemeRef, doFn func(RefWrapper) (bool, error)) error {
311 // Not a valid ref, ignore it and continue

Callers 2

walkComponentsFunction · 0.85
walkResponseRefFunction · 0.85

Calls 1

walkSchemaRefFunction · 0.85

Tested by

no test coverage detected