MCPcopy Create free account
hub / github.com/github/gh-aw / findBestKnownFieldParentPath

Function findBestKnownFieldParentPath

pkg/parser/schema_errors.go:383–395  ·  view source on GitHub ↗
(jsonPath string)

Source from the content-addressed store, hash-verified

381}
382
383func findBestKnownFieldParentPath(jsonPath string) string {
384 bestPath := ""
385 bestLen := 0
386 for path := range knownFieldValidValues {
387 if strings.HasPrefix(jsonPath, path+"/") {
388 if l := len(path); l > bestLen {
389 bestLen = l
390 bestPath = path
391 }
392 }
393 }
394 return bestPath
395}
396
397func appendKnownFieldSuggestions(result, message string, scopes []string) string {
398 if len(scopes) == 0 {

Callers 1

knownFieldHintForPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected