Skip to content
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

If there is no space after the colon after the json tag prefix, a parsing error occurs. #372

Open
warpkwd opened this issue Dec 25, 2024 · 5 comments
Assignees

Comments

@warpkwd
Copy link
Contributor

warpkwd commented Dec 25, 2024

If there is no space after the colon after the json tag prefix, a parsing error occurs.

sbom file is:

  "creationInfo": {
    "created": "2024-12-25T12:00:00Z",
    "creators": [
      "Tool: SPDXExampleTool-1.0",
      "Organization: ExampleOrg",
      "Person:John Doe ([email protected])"   <- no space after colon
    ]

sbomqs is:

sbomqs compliance -D -c sample.json
failed to get sbom document for sample.json
Error: failed to parse Creator 'Person:John Doe ([email protected])'

2024-12-25T20:17:28.828+0900    DEBUG   engine/compliance.go:30 engine.ComplianceRun()
2024-12-25T20:17:28.829+0900    DEBUG   engine/compliance.go:36 Config: &{Path:[sample.json] Categories:[] Features:[] JSON:false Basic:false Detailed:false Pdf:false Spdx:false Cdx:false Recurse:false Debug:true ConfigPath: Ntia:false Bsi:true BsiV2:false Oct:false Fsct:false Color:false}
2024-12-25T20:17:28.829+0900    DEBUG   engine/compliance.go:86 engine.getSbomDocument()
2024-12-25T20:17:28.829+0900    DEBUG   sbom/sbom.go:176        SBOM detect spec:spdx format:json
2024-12-25T20:17:28.829+0900    DEBUG   engine/compliance.go:135        failed to create sbom document for  :sample.json
[sample.json](https://github.com/user-attachments/files/18245682/sample.json)

2024-12-25T20:17:28.829+0900    DEBUG   engine/compliance.go:136        failed to parse Creator 'Person:John Doe ([email protected])'
@warpkwd
Copy link
Contributor Author

warpkwd commented Dec 25, 2024

sample.json

@viveksahu26 viveksahu26 self-assigned this Dec 27, 2024
@viveksahu26
Copy link
Collaborator

Thank you for raising this issue. The issue is reproducible and specifically occurs in the creationInfo.creators section.

@warpkwd
Copy link
Contributor Author

warpkwd commented Dec 27, 2024

I have already submitted a pull request to spdx/tools-golang about this bug.
Thank you.

@viveksahu26
Copy link
Collaborator

It's an upstream issue, already raised by @warpkwd on tools-golang repo: spdx/tools-golang#253

@warpkwd
Copy link
Contributor Author

warpkwd commented Dec 27, 2024

My commit appears to have been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants