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

Function findComponentRefs

pkg/codegen/prune.go:374–386  ·  view source on GitHub ↗
(swagger *openapi3.T)

Source from the content-addressed store, hash-verified

372}
373
374func findComponentRefs(swagger *openapi3.T) []string {
375 refs := []string{}
376
377 _ = walkSwagger(swagger, func(ref RefWrapper) (bool, error) {
378 if ref.Ref != "" {
379 refs = append(refs, ref.Ref)
380 return false, nil
381 }
382 return true, nil
383 })
384
385 return refs
386}
387
388func removeOrphanedComponents(swagger *openapi3.T, refs []string) int {
389 if swagger.Components == nil {

Callers 4

TestFindReferencesFunction · 0.85
TestFilterOnlyCatFunction · 0.85
TestFilterOnlyDogFunction · 0.85
pruneUnusedComponentsFunction · 0.85

Calls 1

walkSwaggerFunction · 0.85

Tested by 3

TestFindReferencesFunction · 0.68
TestFilterOnlyCatFunction · 0.68
TestFilterOnlyDogFunction · 0.68