{"record":{"id":"cc0d389be87e46f3","repo":"larksuite/cli","slug":"field-q-does-not-exist","errorCode":null,"errorMessage":"field %q does not exist","messagePattern":"field %q does not exist","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_compile_contract.go","lineNumber":150,"sourceCode":"\t\t}\n\t\tvar err error\n\t\tcurrent, err = resolveShapeField(current, name)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn current, nil\n}\n\nfunc resolveShapeField(shape typedValueShape, name string) (typedValueShape, error) {\n\tswitch value := shape.(type) {\n\tcase typedObjectShape:\n\t\tfor _, field := range value.Fields {\n\t\t\tif field.Name == name {\n\t\t\t\treturn field.Shape, nil\n\t\t\t}\n\t\t}\n\t\treturn nil, fmt.Errorf(\"field %q does not exist\", name)\n\tcase typedOneOfShape:\n\t\tvar resolved []typedValueShape\n\t\tfor _, variant := range value.Variants {\n\t\t\tif _, null := variant.(typedNullShape); null {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfield, err := resolveShapeField(variant, name)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tresolved = append(resolved, field)\n\t\t}\n\t\treturn combineResolvedShapes(resolved)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"segment %q traverses non-object shape\", name)\n\t}\n}\n","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_compile_contract.go#L132-L168","documentation":"resolveShapeField looks up a field by decoded name inside a typedObjectShape; if no field matches, traversal fails with this error. It occurs while applying an Output.Data override or explicit Shape pointer to a struct whose compiled shape has no field with that name.","triggerScenarios":"compileData with Output.Data.Overrides where an override Path references a nonexistent field (e.g. \"/Nmae\" typo, or a field omitted from the compiled shape due to JSON tags/visibility), or resolveShapePointer called with such a pointer.","commonSituations":"Typos in override paths; renaming a struct field after writing overrides; referencing nested fields that are pointers-to-struct not expanded; fields skipped by compilation (unexported, json:\"-\").","solutions":["Fix the field name in the override Path to match the struct's JSON field name exactly (case-sensitive).","Check the struct's json tags — compilation uses the serialized field name, not the Go name.","If the field genuinely should exist, verify it is exported and not tagged json:\"-\" or omitempty-skipped in the compiled shape."],"exampleFix":"// before\n{Path: \"/userName\", Value: \"x\"} // struct field tagged `json:\"user_name\"`\n// after\n{Path: \"/user_name\", Value: \"x\"}","handlingStrategy":"validation","validationCode":"func pathExists(shapeFields []string, p string) bool {\n  segs := strings.Split(strings.TrimPrefix(p, \"/\"), \"/\")\n  for _, s := range segs {\n    s = strings.ReplaceAll(strings.ReplaceAll(s, \"~1\", \"/\"), \"~0\", \"~\")\n    found := false\n    for _, f := range shapeFields { if f == s { found = true; break } }\n    if !found { return false }\n  }\n  return true\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive override paths from the struct's json tags, not Go field names","Keep path constants next to the struct definition so renames fail at compile time","Grep definitions for override paths and diff against json tags when refactoring"],"tags":["json-pointer","shape-traversal","validation","shortcuts"],"backgroundTag":"field-not-found-in-shape","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"}