{"record":{"id":"70e4673312720930","repo":"larksuite/cli","slug":"field-q-w","errorCode":null,"errorMessage":"field %q: %w","messagePattern":"field %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_shape.go","lineNumber":110,"sourceCode":"\t\t}, nil\n\tcase command.NullShape:\n\t\treturn typedNullShape{}, nil\n\tcase command.ConstShape:\n\t\treturn typedConstShape{Value: cloneJSONValue(value.Value)}, nil\n\tcase command.ArrayShape:\n\t\titems, err := lowerAuthoringShape(value.Items)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn typedArrayShape{\n\t\t\tItems: items, MinItems: cloneScalarPointer(value.MinItems), MaxItems: cloneScalarPointer(value.MaxItems),\n\t\t}, nil\n\tcase command.ObjectShape:\n\t\tfields := make([]typedValueField, len(value.Fields))\n\t\tfor index, field := range value.Fields {\n\t\t\tfieldShape, err := lowerAuthoringShape(field.Shape)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"field %q: %w\", field.Name, err)\n\t\t\t}\n\t\t\tfields[index] = typedValueField{\n\t\t\t\tName: field.Name, Description: field.Description, Required: field.Required, Shape: fieldShape,\n\t\t\t}\n\t\t}\n\t\tadditional, err := lowerAuthoringShape(value.AdditionalPropertiesShape)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn typedObjectShape{\n\t\t\tFields: fields, AdditionalProperties: value.AdditionalProperties,\n\t\t\tAdditionalPropertiesShape: additional,\n\t\t}, nil\n\tcase command.OneOfShape:\n\t\tvariants := make([]typedValueShape, len(value.Variants))\n\t\tfor index, variant := range value.Variants {\n\t\t\tlowered, err := lowerAuthoringShape(variant)\n\t\t\tif err != nil {","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_shape.go#L92-L128","documentation":"lowerAuthoringShape converts public command.ValueShape authoring types into internal lowered shapes. When lowering an ObjectShape, each field's shape is lowered recursively; this wrapper wraps any child failure with the field name so the author can locate the bad field. The inner error is usually 'unsupported public shape %T' from a nested field.","triggerScenarios":"Declaring a Typed input object whose field.Shape is nil-typed-but-non-nil interface, or a custom type that does not implement one of the supported command.ValueShape variants (String/Boolean/Integer/Number/Null/Const/Array/Object/OneOf).","commonSituations":"Hand-rolling a shape struct instead of using the command package's shape constructors; passing a *T pointer or map literal where a concrete shape type is expected; copy-paste from older shortcut code using a removed shape type.","solutions":["Read the full wrapped error chain: 'field \"x\": ... unsupported public shape <T>' tells you the offending field and type.","Replace the offending field's Shape value with a supported constructor (command.StringShape{}, command.ObjectShape{...}, etc.).","Check for nil interface carrying a typed nil pointer; use the concrete zero value of the shape type instead."],"exampleFix":"// before\nfields: []command.DataField{{ Name: \"owner\", Shape: myCustomShape{} }} // unsupported type\n// after\nfields: []command.DataField{{ Name: \"owner\", Shape: command.StringShape{Format: \"open_id\"} }}","handlingStrategy":"validation","validationCode":"// Validate shapes before compiling the input definition:\nfunc checkShape(s command.ValueShape) error {\n    switch t := s.(type) {\n    case nil, command.StringShape, command.BooleanShape, command.IntegerShape,\n        command.NumberShape, command.NullShape, command.ConstShape,\n        command.ArrayShape, command.ObjectShape, command.OneOfShape:\n        return nil\n    default:\n        return fmt.Errorf(\"unsupported shape %T\", t)\n    }\n}","typeGuard":"func isSupportedShape(s command.ValueShape) bool {\n    switch s.(type) {\n    case nil, command.StringShape, command.BooleanShape, command.IntegerShape,\n        command.NumberShape, command.NullShape, command.ConstShape,\n        command.ArrayShape, command.ObjectShape, command.OneOfShape:\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Only use documented command.*Shape constructors; never hand-roll structs implementing ValueShape.","Avoid pointers to shapes — pass concrete values.","Compile the input definition in a unit test so lowering errors fail fast."],"tags":["go","schema","typed-input","shape-lowering","developer-error"],"backgroundTag":"unsupported-shape-type","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"}