{"record":{"id":"e9dacd6c4f13d084","repo":"goharbor/harbor","slug":"empty-json-data-to-parse-e9dacd","errorCode":null,"errorMessage":"empty json data to parse","messagePattern":"empty json data to parse","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/scan/rest/v1/models.go","lineNumber":214,"sourceCode":"\tArtifact *Artifact `json:\"artifact\"`\n\t// RequestType\n\tRequestType []*ScanType `json:\"enabled_capabilities\"`\n}\n\n// ScanType represent the type of the scan request\ntype ScanType struct {\n\t// Type sets the type of the scan, it could be sbom or vulnerability, default is vulnerability\n\tType string `json:\"type\"`\n\t// ProducesMimeTypes defines scanreport should be\n\tProducesMimeTypes []string `json:\"produces_mime_types\"`\n\t// Parameters extra parameters\n\tParameters map[string]any `json:\"parameters\"`\n}\n\n// FromJSON parses ScanRequest from json data\nfunc (s *ScanRequest) FromJSON(jsonData string) error {\n\tif len(jsonData) == 0 {\n\t\treturn errors.New(\"empty json data to parse\")\n\t}\n\n\treturn json.Unmarshal([]byte(jsonData), s)\n}\n\n// ToJSON marshals ScanRequest to JSON data\nfunc (s *ScanRequest) ToJSON() (string, error) {\n\tdata, err := json.Marshal(s)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn string(data), nil\n}\n\n// Validate ScanRequest\nfunc (s *ScanRequest) Validate() error {\n\tif s.Registry == nil ||","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/scan/rest/v1/models.go#L196-L232","documentation":"Error \"empty json data to parse\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/scan/rest/v1/models.go:214 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"}