convertInstanceLocationToJSONPath converts jsonschema InstanceLocation to JSON path string
(location []string)
| 57 | |
| 58 | // convertInstanceLocationToJSONPath converts jsonschema InstanceLocation to JSON path string |
| 59 | func 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 |
| 72 | func LocateJSONPathInYAML(yamlContent string, jsonPath string) JSONPathLocation { |
no outgoing calls
no test coverage detected