(ref *openapi3.ExampleRef, doFn func(RefWrapper) (bool, error))
| 350 | } |
| 351 | |
| 352 | func 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 | |
| 374 | func findComponentRefs(swagger *openapi3.T) []string { |
| 375 | refs := []string{} |
no outgoing calls
no test coverage detected