{"record":{"id":"2973d653832f71d6","repo":"go-playground/validator","slug":"unrecognized-parameter","errorCode":null,"errorMessage":"Unrecognized parameter: ","messagePattern":"Unrecognized parameter: ","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baked_in.go","lineNumber":3466,"sourceCode":"\tval := fl.Field().String()\n\treturn mongodbConnectionRegex().MatchString(val)\n}\n\n// isSpiceDB is the validation function for validating if the current field's value is valid for use with Authzed SpiceDB in the indicated way\nfunc isSpiceDB(fl FieldLevel) bool {\n\tval := fl.Field().String()\n\tparam := fl.Param()\n\n\tswitch param {\n\tcase \"permission\":\n\t\treturn spicedbPermissionRegex().MatchString(val)\n\tcase \"type\":\n\t\treturn spicedbTypeRegex().MatchString(val)\n\tcase \"id\", \"\":\n\t\treturn spicedbIDRegex().MatchString(val)\n\t}\n\n\tpanic(\"Unrecognized parameter: \" + param)\n}\n\n// isCreditCard is the validation function for validating if the current field's value is a valid credit card number\nfunc isCreditCard(fl FieldLevel) bool {\n\tval := fl.Field().String()\n\tvar creditCard bytes.Buffer\n\tsegments := strings.Split(val, \" \")\n\tfor _, segment := range segments {\n\t\tif len(segment) < 3 {\n\t\t\treturn false\n\t\t}\n\t\tcreditCard.WriteString(segment)\n\t}\n\n\tccDigits := strings.Split(creditCard.String(), \"\")\n\tsize := len(ccDigits)\n\tif size < 12 || size > 19 {\n\t\treturn false","sourceCodeStart":3448,"sourceCodeEnd":3484,"githubUrl":"https://github.com/go-playground/validator/blob/facf128d2eecf42bd4ff447adc961aa21bb64aed/baked_in.go#L3448-L3484","documentation":"The SpiceDB tag validator (`isSpiceDB`, tags `spicedb_id`/`spicedb_type` with a `param` selector) only recognizes parameters \"id\", \"type\", or empty. Any other parameter value reaches a panic('Unrecognized parameter: ' + param).","triggerScenarios":"Using a tag like `spicedb_foo` or registering `isSpiceDB` under a name/alias whose parameter extraction yields an unsupported string, e.g. a misspelled `spicedb_id` variant or custom registration passing an unexpected param.","commonSituations":"Typo in the tag name (e.g. `spicedb_typ`), hand-rolled alias expansion producing an unexpected param, or registering the function under a new tag name without updating its switch.","solutions":["Use only the documented tags `spicedb_id` and `spicedb_type`","Fix the alias/tag registration so the param is \"id\" or \"type\"","Register your own validator function instead of reusing isSpiceDB with a custom name","Add recover() around validation during development to surface the bad tag early"],"exampleFix":"// before\nID string `validate:\"spicedb_typ\"`\n// after\nID string `validate:\"spicedb_id\"`","handlingStrategy":"validation","validationCode":"allowed := map[string]bool{\"spicedb_id\": true, \"spicedb_type\": true}\n// verify struct tags before validating:\nfor _, f := range reflect.TypeOf(obj).Fields() {\n    tag := f.Tag.Get(\"validate\")\n    for _, t := range strings.Split(tag, \",\") {\n        if strings.HasPrefix(t, \"spicedb_\") && !allowed[t] {\n            panic(\"bad spicedb tag: \" + t)\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":"defer func() {\n    if r := recover(); r != nil {\n        if strings.HasPrefix(fmt.Sprint(r), \"Unrecognized parameter\") {\n            err = fmt.Errorf(\"bad validator tag: %v\", r)\n        } else { panic(r) }\n    }\n}()","preventionTips":["Use only spicedb_id and spicedb_type tags","Do not register isSpiceDB under custom tag names","Fix typos like spicedb_typ","Write a test that validates a sample SpiceDB-tagged struct"],"tags":["go","validator","panic","tag-parameter","spicedb"],"backgroundTag":"validator-unrecognized-tag-parameter","analyzedSha":"facf128d2eecf42bd4ff447adc961aa21bb64aed","analyzedAt":"2026-09-02T10:19:04.986Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T16:17:10.729Z"}