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

fixing bug in jsonsaver #100

Closed
wants to merge 1 commit into from
Closed

fixing bug in jsonsaver #100

wants to merge 1 commit into from

Conversation

yanyag
Copy link

@yanyag yanyag commented Nov 25, 2021

Avoid producing invalid json with "Files: null" and "Snippets: null" if saving a package without files (filesAnalyzed is false)

Signed-off-by: Yan Yagudayev yanyag@gmail.com

@yanyag
Copy link
Author

yanyag commented Dec 5, 2021

@swinslow,
Could you please review and approve this small bug fix?

… null" and "Snippets: null" if saving a package without files (filesAnalyzed is false)

Signed-off-by: Yan Yagudayev <yany@jfrog.com>
@swinslow
Copy link
Member

Hi @yanyag, thanks very much for this -- and my apologies for the slow response, as I haven't turned back to the SPDX Golang tools for a while.

I've created an issue for this at #103. I think the PR you shared here is a good start, though I'm not sure it sufficiently solves the issue. For instance, if an SPDX Document contains some Files but no Snippets, then snippets: null will still be outputted. It also looks like there are some other properties (e.g. externalDocumentRefs) where the same null issue is happening.

I'll dig a bit deeper into the jsonsaver code to see how best to address this.

Separately, I noted the change you proposed in this PR to save_document_test.go. Can you help clarify for me what the changed / additional tests are meant to add? It wasn't immediately obvious to me, but I might need to stare at them a bit more...

@swinslow
Copy link
Member

Hi @yanyag, the remaining issues I mentioned in the prior comment were resolved with #106, so I'm closing this PR. Thank you for raising the issue!

@swinslow swinslow closed this Mar 13, 2022
@yanyag
Copy link
Author

yanyag commented Mar 15, 2022

Thanks a lot @swinslow

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

Successfully merging this pull request may close these issues.

2 participants