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

Allow to add arbitrary values to PropertyBag #101

Merged
merged 25 commits into from
Feb 27, 2024
Merged

Allow to add arbitrary values to PropertyBag #101

merged 25 commits into from
Feb 27, 2024

Conversation

BraisGabin
Copy link
Member

@BraisGabin BraisGabin commented Feb 13, 2024

Fix #78

I would like to get feedback from the API. I don't like too much that PropertyBag is now a Map<String, JsonElement> because that couples us with kotlinx.serialization. But I don't see other way to implement this:

The property values MAY be of any JSON type, including strings, numbers, arrays, objects, Booleans, and null. If a property value is a string, it MAY be an empty string.

(Extracted from the specification: https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/sarif-v2.1.0-errata01-os-complete.html#_Toc141790698)

Any feedback is more than welcome

I was facing this issue: Kotlin/kotlinx.serialization#296 so I needed to create those chunky functions. They are not bullet proof but they should do the job.

@BraisGabin BraisGabin marked this pull request as draft February 13, 2024 16:29
@BraisGabin BraisGabin requested review from chao2zhang and removed request for chao2zhang February 13, 2024 18:25
@BraisGabin BraisGabin marked this pull request as ready for review February 13, 2024 18:26
Co-authored-by: Róbert Papp <papp.robert.s@gmail.com>
@BraisGabin
Copy link
Member Author

Ok, I think that I fixed all the comments. Thanks for the reviews! And with the test that I added in the last commit it feels more secure.

Copy link
Member

@TWiStErRob TWiStErRob left a comment

Choose a reason for hiding this comment

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

Sorry, I guess I looked deeper now than previously? 😅

Note: I did the review on my phone because I'm sick in bed, so there might be some weird comments. 😵‍💫

@BraisGabin
Copy link
Member Author

Sorry, I guess I looked deeper now than previously? 😅

No need to apology! This review was great :)

BraisGabin and others added 4 commits February 27, 2024 00:06
…nsions.kt

Co-authored-by: Róbert Papp <papp.robert.s@gmail.com>
…gs.kt

Co-authored-by: Róbert Papp <papp.robert.s@gmail.com>
…gs.kt

Co-authored-by: Róbert Papp <papp.robert.s@gmail.com>
@BraisGabin
Copy link
Member Author

Ok, I think that now it's ready

@BraisGabin BraisGabin enabled auto-merge (squash) February 27, 2024 11:25
@BraisGabin BraisGabin merged commit 590a17e into main Feb 27, 2024
2 checks passed
@BraisGabin BraisGabin deleted the fix-78 branch February 27, 2024 11:28
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.

PropertyBag appears to be implemented different from its doc
2 participants