MCPcopy
hub / github.com/danielgtaylor/huma / findInType

Function findInType

huma.go:471–475  ·  view source on GitHub ↗

findInType traverses a type and identifies elements based on specified callbacks and optional recursion settings.

(t reflect.Type, onType func(reflect.Type, []int) T, onField func(reflect.StructField, []int) T, recurseFields bool, ignore ...string)

Source from the content-addressed store, hash-verified

469// findInType traverses a type and identifies elements based on specified callbacks
470// and optional recursion settings.
471func findInType[T comparable](t reflect.Type, onType func(reflect.Type, []int) T, onField func(reflect.StructField, []int) T, recurseFields bool, ignore ...string) *findResult[T] {
472 result := &findResult[T]{}
473 _findInType(t, []int{}, result, onType, onField, recurseFields, make(map[reflect.Type]struct{}), ignore...)
474 return result
475}
476
477func _findInType[T comparable](t reflect.Type, path []int, result *findResult[T], onType func(reflect.Type, []int) T, onField func(reflect.StructField, []int) T, recurseFields bool, visited map[reflect.Type]struct{}, ignore ...string) {
478 t = deref(t)

Callers 4

findParamsFunction · 0.85
findResolversFunction · 0.85
findDefaultsFunction · 0.85
findHeadersFunction · 0.85

Calls 1

_findInTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…