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

Error if invalid json is passed. #84

Merged
merged 1 commit into from Mar 30, 2023

Conversation

justinabrahms
Copy link
Contributor

The json decoder is too forgiving because it's built for streaming json. This means that if you have additional data after a valid piece of json.. it works, which I don't think is expected.

Here's a relevant blog post: https://mottaquikarim.github.io/dev/posts/you-might-not-be-using-json.decoder-correctly-in-golang/

(cheers to @mottaquikarim for it)

@justinabrahms justinabrahms requested a review from a team as a code owner March 30, 2023 17:00
Signed-off-by: Justin Abrahms <justin@abrah.ms>
Copy link
Member

@nscuro nscuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @justinabrahms! 🙌

@nscuro nscuro added this to the v0.8.0 milestone Mar 30, 2023
@nscuro nscuro added the enhancement New feature or request label Mar 30, 2023
@nscuro nscuro merged commit b1105ec into CycloneDX:master Mar 30, 2023
8 checks passed
@justinabrahms justinabrahms deleted the invalid-json branch March 30, 2023 21:54
@nscuro nscuro modified the milestones: v0.8.0, v0.7.1 Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants