{"record":{"id":"bbfd888ccfa3b354","repo":"goharbor/harbor","slug":"empty-json-data-bbfd88","errorCode":null,"errorMessage":"empty JSON data","messagePattern":"empty JSON data","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/scan/report/supported_mimes.go","lineNumber":43,"sourceCode":"\n// SupportedMimes indicates what mime types are supported to render at UI end.\nvar SupportedMimes = map[string]any{\n\t// The native report type\n\tv1.MimeTypeNativeReport:               (*vuln.Report)(nil),\n\tv1.MimeTypeGenericVulnerabilityReport: (*vuln.Report)(nil),\n}\n\n// ResolveData is a helper func to parse the JSON data with the given mime type.\nfunc ResolveData(mime string, jsonData []byte, options ...Option) (any, error) {\n\t// If no resolver defined for the given mime types, directly ignore it.\n\t// The raw data will be used.\n\tt, ok := SupportedMimes[mime]\n\tif !ok {\n\t\treturn nil, nil\n\t}\n\n\tif len(jsonData) == 0 {\n\t\treturn nil, errors.New(\"empty JSON data\")\n\t}\n\n\tty := reflect.TypeOf(t)\n\tif ty.Kind() == reflect.Ptr {\n\t\tty = ty.Elem()\n\t}\n\n\t// New one\n\trp := reflect.New(ty).Elem().Addr().Interface()\n\n\tif err := json.Unmarshal(jsonData, rp); err != nil {\n\t\treturn nil, err\n\t}\n\n\tops := &Options{}\n\tfor _, op := range options {\n\t\top(ops)\n\t}","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/scan/report/supported_mimes.go#L25-L61","documentation":"Error \"empty JSON data\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/scan/report/supported_mimes.go:43 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"}