{"record":{"id":"4d7afa2662f4cb64","repo":"larksuite/cli","slug":"output-data-overrides-d-path-q-must-be-an-rfc-6","errorCode":null,"errorMessage":"Output.Data.Overrides[%d].Path %q must be an RFC 6901 JSON Pointer","messagePattern":"Output\\.Data\\.Overrides\\[(.+?)\\]\\.Path %q must be an RFC 6901 JSON Pointer","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_compile_data.go","lineNumber":52,"sourceCode":"\t\t}\n\t\treturn shape, nil\n\t}\n\tif dataType.Kind() == reflect.Interface && dataType.NumMethod() == 0 {\n\t\tif len(definition.Overrides) > 0 {\n\t\t\treturn nil, fmt.Errorf(\"Output.Data.Overrides require struct Data\")\n\t\t}\n\t\treturn anyJSONShape{}, nil\n\t}\n\tif dataType.Kind() != reflect.Struct {\n\t\treturn nil, fmt.Errorf(\"Data must be a non-pointer struct or any unless Output.Data.Shape is explicit, got %s\", dataType)\n\t}\n\tshape, err := compileStructShape(dataType, false, \"Data\", map[reflect.Type]struct{}{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor i, override := range definition.Overrides {\n\t\tif override.Path == \"\" || !strings.HasPrefix(override.Path, \"/\") {\n\t\t\treturn nil, fmt.Errorf(\"Output.Data.Overrides[%d].Path %q must be an RFC 6901 JSON Pointer\", i, override.Path)\n\t\t}\n\t\tif err := applyDataOverride(&shape, override); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Output.Data.Overrides[%d] path %q: %w\", i, override.Path, err)\n\t\t}\n\t}\n\tif err := validateShape(shape, \"Output.Data\"); err != nil {\n\t\treturn nil, err\n\t}\n\treturn shape, nil\n}\n\n// shapeForType derives the ValueShape of one Go type. active carries the struct\n// types on the current recursion path so a self-referential type is rejected\n// with a compile error; see compileStructShape.\nfunc shapeForType(t reflect.Type, schema schemaTag, input bool, active map[reflect.Type]struct{}) (typedValueShape, error) {\n\tbaseType := t\n\tfor baseType.Kind() == reflect.Pointer {\n\t\tbaseType = baseType.Elem()","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_compile_data.go#L34-L70","documentation":"Each Output.Data.Overrides entry must use an RFC 6901 JSON Pointer, which must be non-empty and start with '/'. compileData checks this before applying the override and reports the index and offending path value.","triggerScenarios":"compileData with an Overrides entry whose Path is \"\" (empty) or lacks the leading '/' (e.g. \"name\" or \"a/b\").","commonSituations":"Passing a bare field name instead of a pointer; forgetting the leading slash; empty Path from a zero-value override struct; building paths with dot notation (\"a.b\") instead of pointer notation (\"/a/b\").","solutions":["Prefix the Path with '/': \"/name\" instead of \"name\".","Convert dot-notation paths to slash-notation: \"a.b\" -> \"/a/b\".","Ensure the Path field is actually set (guard against zero-value Override structs)."],"exampleFix":"// before\n{Path: \"name\", Value: \"x\"}\n// after\n{Path: \"/name\", Value: \"x\"}","handlingStrategy":"validation","validationCode":"func mustPointerPath(p string) string {\n  if p == \"\" || p[0] != '/' { panic(\"path must be RFC 6901 pointer: \" + p) }\n  return p\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always write paths with a leading '/'","Convert dot notation to slash notation when porting paths","Use a helper (ptr(\"a\",\"b\") -> \"/a/b\") instead of hand-written strings"],"tags":["json-pointer","rfc6901","overrides","shortcuts"],"backgroundTag":"invalid-json-pointer-format","analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}