{"record":{"id":"f532f4138f173968","repo":"goharbor/harbor","slug":"bad-request-f532f4","errorCode":"BAD_REQUEST","errorMessage":"the type of filter value isn't string","messagePattern":"the type of filter value isn't string","errorType":"validation","errorClass":"lib/errors.Error","httpStatus":400,"severity":"error","filePath":"src/pkg/reg/model/policy.go","lineNumber":48,"sourceCode":"\t// Matches [pattern] for tag (default)\n\tMatches = \"matches\"\n\t// Excludes [pattern] for tag\n\tExcludes = \"excludes\"\n)\n\n// Filter holds the info of the filter\ntype Filter struct {\n\tType       string `json:\"type\"`\n\tValue      any    `json:\"value\"`\n\tDecoration string `json:\"decoration,omitempty\"`\n}\n\nfunc (f *Filter) Validate() error {\n\tswitch f.Type {\n\tcase FilterTypeResource, FilterTypeName, FilterTypeTag:\n\t\tvalue, ok := f.Value.(string)\n\t\tif !ok {\n\t\t\treturn errors.New(nil).WithCode(errors.BadRequestCode).\n\t\t\t\tWithMessage(\"the type of filter value isn't string\")\n\t\t}\n\t\tif f.Type == FilterTypeResource {\n\t\t\trt := value\n\t\t\tif !(rt == ResourceTypeArtifact || rt == ResourceTypeImage) {\n\t\t\t\treturn errors.New(nil).WithCode(errors.BadRequestCode).\n\t\t\t\t\tWithMessagef(\"invalid resource filter: %s\", value)\n\t\t\t}\n\t\t}\n\t\tif f.Type == FilterTypeName || f.Type == FilterTypeResource {\n\t\t\tif f.Decoration != \"\" {\n\t\t\t\treturn errors.New(nil).WithCode(errors.BadRequestCode).\n\t\t\t\t\tWithMessage(\"only tag and label filter support decoration\")\n\t\t\t}\n\t\t}\n\tcase FilterTypeLabel:\n\t\tlabels, ok := f.Value.([]any)\n\t\tif !ok {","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/reg/model/policy.go#L30-L66","documentation":"Error \"the type of filter value isn't string\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/reg/model/policy.go:48 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}