{"record":{"id":"162d74148a909d80","repo":"larksuite/cli","slug":"schema-cannot-declare-both-nullable-and-nonnullabl","errorCode":null,"errorMessage":"schema cannot declare both nullable and nonnullable","messagePattern":"schema cannot declare both nullable and nonnullable","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_compile_args.go","lineNumber":428,"sourceCode":"\t\t}\n\t\tseen[key] = struct{}{}\n\t\tswitch key {\n\t\tcase \"required\":\n\t\t\tif hasValue {\n\t\t\t\treturn result, fmt.Errorf(\"schema token required does not accept a value\")\n\t\t\t}\n\t\t\tresult.required = true\n\t\tcase \"optional\":\n\t\t\tif hasValue {\n\t\t\t\treturn result, fmt.Errorf(\"schema token optional does not accept a value\")\n\t\t\t}\n\t\t\tresult.optional = true\n\t\tcase \"nullable\", \"nonnullable\":\n\t\t\tif hasValue {\n\t\t\t\treturn result, fmt.Errorf(\"schema token %s does not accept a value\", key)\n\t\t\t}\n\t\t\tif result.nullable != nil {\n\t\t\t\treturn result, fmt.Errorf(\"schema cannot declare both nullable and nonnullable\")\n\t\t\t}\n\t\t\tv := key == \"nullable\"\n\t\t\tresult.nullable = &v\n\t\tcase \"default\":\n\t\t\tif !hasValue || value == \"\" {\n\t\t\t\treturn result, fmt.Errorf(\"schema default requires a JSON literal\")\n\t\t\t}\n\t\t\tif !input {\n\t\t\t\treturn result, fmt.Errorf(\"Data field cannot declare default\")\n\t\t\t}\n\t\t\tvar decoded any\n\t\t\tif err := json.Unmarshal([]byte(value), &decoded); err != nil {\n\t\t\t\treturn result, fmt.Errorf(\"schema default is not valid JSON: %w\", err)\n\t\t\t}\n\t\t\tresult.defaultValue = typedInputDefault{Set: true, Value: decoded}\n\t\tcase \"enum\":\n\t\t\tif !hasValue || value == \"\" {\n\t\t\t\treturn result, fmt.Errorf(\"schema enum requires at least one value\")","sourceCodeStart":410,"sourceCodeEnd":446,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_compile_args.go#L410-L446","documentation":"Schema tag parse guard: a field declares both nullable and nonnullable schema tokens, which are mutually exclusive nullability declarations.","triggerScenarios":"Thrown at shortcuts/common/typed_compile_args.go:428 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep only one of nullable/nonnullable in the tag"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}