-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A JSON file containing raw newline characters does not produce an error #353
Comments
here it is. |
Hey @warpkwd , can you provide that json file ? |
$ sbomqs compliance -n -D tt.json 2>err
Compliance score by Interlynk Score:4.1 RequiredScore:4.1 OptionalScore:0.0 for tt.json
* indicates optional fields
+-------------------------------------+------------+--------------------------------+------------------------------------------------------------------+-------+
| ELEMENT ID | SECTION ID | NTIA MINIMUM ELEMENTS | RESULT | SCORE |
+-------------------------------------+------------+--------------------------------+------------------------------------------------------------------+-------+
| Automation Support | 1.1 | Machine-Readable Formats | spdx, yaml | 10.0 |
+-------------------------------------+------------+--------------------------------+------------------------------------------------------------------+-------+
| SBOM Data Fields | 2.1 | Author | Yukihiro Kawada | 10.0 |
+ +------------+--------------------------------+------------------------------------------------------------------+-------+
| | 2.2 | Timestamp | 2023-01-12T22:06:03Z | 10.0 |
+ +------------+--------------------------------+------------------------------------------------------------------+-------+
$ cat err
2024-11-19T06:50:38.984+0900 DEBUG engine/compliance.go:30 engine.ComplianceRun()
2024-11-19T06:50:39.005+0900 DEBUG engine/compliance.go:36 Config: &{Path:[tt.json] Categories:[] Features:[] JSON:false Basic:false Detailed:false Pdf:false Spdx:false Cdx:false Recurse:false Debug:true ConfigPath: Ntia:true Bsi:false Oct:false Fsct:false Color:false}
2024-11-19T06:50:39.005+0900 DEBUG engine/compliance.go:84 engine.getSbomDocument()
2024-11-19T06:50:39.007+0900 DEBUG sbom/sbom.go:176 SBOM detect spec:spdx format:yaml
2024-11-19T06:50:39.012+0900 DEBUG compliance/compliance.go:47 compliance.ComplianceResult()
2024-11-19T06:50:39.013+0900 DEBUG compliance/ntia.go:43 compliance.ntiaResult()
2024-11-19T06:50:39.055+0900 DEBUG engine/compliance.go:78 Compliance Report: tt.json |
Yes, the error is correct: $ go run main.go compliance -n -D tt.json
2024-11-19T09:52:21.981+0530 DEBUG engine/compliance.go:30 engine.ComplianceRun()
2024-11-19T09:52:21.981+0530 DEBUG engine/compliance.go:36 Config: &{Path:[tt.json] Categories:[] Features:[] JSON:false Basic:false Detailed:false Pdf:false Spdx:false Cdx:false Recurse:false Debug:true ConfigPath: Ntia:true Bsi:false Oct:false Fsct:false Color:false}
2024-11-19T09:52:21.981+0530 DEBUG engine/compliance.go:84 engine.getSbomDocument()
err1: invalid character '\n' in string literal
err4(NewSBOMDocument) : invalid character '\n' in string literal
err: invalid character '\n' in string literal
2024-11-19T09:52:21.982+0530 DEBUG engine/compliance.go:134 failed to create sbom document for :tt.json
2024-11-19T09:52:21.982+0530 DEBUG engine/compliance.go:135 invalid character '\n' in string literal
failed to parse tt.json : invalid character '\n' in string literal
2024-11-19T09:52:21.982+0530 DEBUG engine/compliance.go:40 getSbomDocument failed for file :tt.json
failed to get sbom document for tt.json
Error: invalid character '\n' in string literal
|
Draft
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A JSON file containing raw newline characters does not produce an error.
I want a JSON file containing raw newline characters to trigger a parser error, but it does not.
While the JSON parser does report an error, it proceeds to the next step without halting,
where the file appears to be accepted and processed as YAML format instead.
The text was updated successfully, but these errors were encountered: