stripDetailLinePrefix removes the "'path' (line N, col M): " prefix from a formatSchemaFailureDetail result. This prefix is redundant for single-failure errors because the IDE-compatible "file:line:col: error:" header already encodes the position; stripping it avoids the information appearing twice
(detail string)
| 339 | // errors because the IDE-compatible "file:line:col: error:" header already encodes |
| 340 | // the position; stripping it avoids the information appearing twice to the user. |
| 341 | func stripDetailLinePrefix(detail string) string { |
| 342 | return pathPositionPrefixPattern.ReplaceAllString(detail, "") |
| 343 | } |
| 344 | |
| 345 | // validateWithSchemaAndLocation validates frontmatter against a JSON schema with location information |
| 346 | func validateWithSchemaAndLocation(frontmatter map[string]any, schemaJSON, context, filePath string) error { |
no outgoing calls