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

Function walkExampleRef

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

Source from the content-addressed store, hash-verified

350}
351
352func walkExampleRef(ref *openapi3.ExampleRef, doFn func(RefWrapper) (bool, error)) error {
353 // Not a valid ref, ignore it and continue
354 if ref == nil {
355 return nil
356 }
357 refWrapper := RefWrapper{Ref: ref.Ref, HasValue: ref.Value != nil, SourceRef: ref}
358 shouldContinue, err := doFn(refWrapper)
359 if err != nil {
360 return err
361 }
362 if !shouldContinue {
363 return nil
364 }
365 if ref.Value == nil {
366 return nil
367 }
368
369 // NOTE: `ExampleRef`s don't contain any children that can contain refs
370
371 return nil
372}
373
374func findComponentRefs(swagger *openapi3.T) []string {
375 refs := []string{}

Callers 4

walkComponentsFunction · 0.85
walkParameterRefFunction · 0.85
walkRequestBodyRefFunction · 0.85
walkResponseRefFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected