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

Function walkLinkRef

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

Source from the content-addressed store, hash-verified

330}
331
332func walkLinkRef(ref *openapi3.LinkRef, doFn func(RefWrapper) (bool, error)) error {
333 // Not a valid ref, ignore it and continue
334 if ref == nil {
335 return nil
336 }
337 refWrapper := RefWrapper{Ref: ref.Ref, HasValue: ref.Value != nil, SourceRef: ref}
338 shouldContinue, err := doFn(refWrapper)
339 if err != nil {
340 return err
341 }
342 if !shouldContinue {
343 return nil
344 }
345 if ref.Value == nil {
346 return nil
347 }
348
349 return nil
350}
351
352func walkExampleRef(ref *openapi3.ExampleRef, doFn func(RefWrapper) (bool, error)) error {
353 // Not a valid ref, ignore it and continue

Callers 2

walkComponentsFunction · 0.85
walkResponseRefFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected