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

Function convertInstanceLocationToJSONPath

pkg/parser/json_path_locator.go:59–69  ·  view source on GitHub ↗

convertInstanceLocationToJSONPath converts jsonschema InstanceLocation to JSON path string

(location []string)

Source from the content-addressed store, hash-verified

57
58// convertInstanceLocationToJSONPath converts jsonschema InstanceLocation to JSON path string
59func convertInstanceLocationToJSONPath(location []string) string {
60 if len(location) == 0 {
61 return ""
62 }
63
64 var parts []string
65 for _, part := range location {
66 parts = append(parts, "/"+part)
67 }
68 return strings.Join(parts, "")
69}
70
71// LocateJSONPathInYAML finds the line/column position of a JSON path in YAML source
72func LocateJSONPathInYAML(yamlContent string, jsonPath string) JSONPathLocation {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected