{"record":{"id":"aa2f93d289e20581","repo":"larksuite/cli","slug":"unknown-schema-token-q","errorCode":null,"errorMessage":"unknown schema token %q","messagePattern":"unknown schema token %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_compile_args.go","lineNumber":491,"sourceCode":"\t\t\tv, err := parseFiniteFloat(value)\n\t\t\tif err != nil {\n\t\t\t\treturn result, fmt.Errorf(\"schema maximum: %w\", err)\n\t\t\t}\n\t\t\tresult.maximum = &v\n\t\tcase \"minItems\":\n\t\t\tv, err := parseNonnegativeInt(value)\n\t\t\tif err != nil {\n\t\t\t\treturn result, fmt.Errorf(\"schema minItems: %w\", err)\n\t\t\t}\n\t\t\tresult.minItems = &v\n\t\tcase \"maxItems\":\n\t\t\tv, err := parseNonnegativeInt(value)\n\t\t\tif err != nil {\n\t\t\t\treturn result, fmt.Errorf(\"schema maxItems: %w\", err)\n\t\t\t}\n\t\t\tresult.maxItems = &v\n\t\tdefault:\n\t\t\treturn result, fmt.Errorf(\"unknown schema token %q\", key)\n\t\t}\n\t}\n\tif result.required == result.optional {\n\t\treturn result, fmt.Errorf(\"schema must declare exactly one of required or optional\")\n\t}\n\tif result.required && result.defaultValue.Set {\n\t\treturn result, fmt.Errorf(\"required input cannot declare default\")\n\t}\n\tif result.nullable != nil && *result.nullable && !isNilCapable(valueType) {\n\t\treturn result, fmt.Errorf(\"nullable requires a nil-capable Go type\")\n\t}\n\tif result.minLength != nil && result.maxLength != nil && *result.minLength > *result.maxLength {\n\t\treturn result, fmt.Errorf(\"minLength exceeds maxLength\")\n\t}\n\tif result.minimum != nil && result.maximum != nil && *result.minimum > *result.maximum {\n\t\treturn result, fmt.Errorf(\"minimum exceeds maximum\")\n\t}\n\tif result.minItems != nil && result.maxItems != nil && *result.minItems > *result.maxItems {","sourceCodeStart":473,"sourceCodeEnd":509,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_compile_args.go#L473-L509","documentation":"parseSchemaTag only accepts a fixed set of schema tag keys (required, optional, nullable, nonnullable, default, enum, format, minLength, maxLength, minimum, maximum, minItems, maxItems). Any other key in the semicolon-separated tag triggers this error, which is a compile-time guard against silently ignoring misspelled constraints.","triggerScenarios":"A tag containing an unrecognized key, e.g. schema:\"required;minLenght=3\" (typo) or schema:\"required;unique=true\".","commonSituations":"Misspelled token names (minLength/minLenght, nullable/nulable), tokens invented by analogy with JSON Schema, or tags copied from a different library with a different tag grammar.","solutions":["Check the spelling against the supported token list and fix the key name.","Remove tokens that have no equivalent in this library.","Consult the shortcut typed-input docs for the exact supported tag grammar."],"exampleFix":"// before\nName string `schema:\"required;minLenght=3\"`\n// after\nName string `schema:\"required;minLength=3\"`","handlingStrategy":"validation","validationCode":"var schemaKeys = map[string]bool{\"required\": true, \"optional\": true, \"nullable\": true, \"nonnullable\": true, \"default\": true, \"enum\": true, \"format\": true, \"minLength\": true, \"maxLength\": true, \"minimum\": true, \"maximum\": true, \"minItems\": true, \"maxItems\": true}\n\nfunc tokensKnown(tag string) bool {\n\tfor _, tok := range strings.Split(tag, \";\") {\n\t\tk, _, _ := strings.Cut(tok, \"=\")\n\t\tif !schemaKeys[k] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy token names from an existing valid schema tag instead of typing them.","Watch for camelCase: minLength/maxLength/minItems/maxItems, minimum/maximum.","Add a compile-time test over all input structs so unknown tokens fail CI."],"tags":["go","struct-tags","typo","schema-validation"],"backgroundTag":"unknown-schema-tag-token","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"}