{"record":{"id":"50f84e19e484b4f8","repo":"sipeed/picoclaw","slug":"s-type-error-at-line-d-column-d-for-field-q","errorCode":null,"errorMessage":"%s type error at line %d, column %d for field %q: expected %s but got %s\\n%s","messagePattern":"(.+?) type error at line (.+?), column (.+?) for field %q: expected (.+?) but got (.+?)\\\\n(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/diagnostics.go","lineNumber":86,"sourceCode":"\t\tpreview := diagnosticPreviewForOffset(data, e.Offset)\n\t\tif preview != \"\" {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"%s syntax error at line %d, column %d: %w\\n%s\",\n\t\t\t\tlabel,\n\t\t\t\tline,\n\t\t\t\tcolumn,\n\t\t\t\terr,\n\t\t\t\tpreview,\n\t\t\t)\n\t\t}\n\t\treturn fmt.Errorf(\"%s syntax error at line %d, column %d: %w\", label, line, column, err)\n\tcase *json.UnmarshalTypeError:\n\t\tline, column := lineAndColumnForOffset(data, e.Offset)\n\t\tpreview := diagnosticPreviewForOffset(data, e.Offset)\n\t\tfield := strings.TrimSpace(e.Field)\n\t\tif field != \"\" {\n\t\t\tif preview != \"\" {\n\t\t\t\treturn fmt.Errorf(\n\t\t\t\t\t\"%s type error at line %d, column %d for field %q: expected %s but got %s\\n%s\",\n\t\t\t\t\tlabel,\n\t\t\t\t\tline,\n\t\t\t\t\tcolumn,\n\t\t\t\t\tfield,\n\t\t\t\t\te.Type.String(),\n\t\t\t\t\te.Value,\n\t\t\t\t\tpreview,\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"%s type error at line %d, column %d for field %q: expected %s but got %s\",\n\t\t\t\tlabel,\n\t\t\t\tline,\n\t\t\t\tcolumn,\n\t\t\t\tfield,\n\t\t\t\te.Type.String(),\n\t\t\t\te.Value,","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/config/diagnostics.go#L68-L104","documentation":"wrapJSONError branch for json.UnmarshalTypeError with a known field name and preview: a value has the right JSON location but the wrong type (e.g. a string where a number is expected). Names the field, expected type, actual value, and shows the offending line preview.","triggerScenarios":"Thrown at pkg/config/diagnostics.go:86 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Change the field's value to the expected type shown in the message (e.g. quote or unquote it)","Check the documented schema for that field's type","Watch for JSON numbers written as strings (\"8080\" vs 8080)"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","contentChangedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}