detekt / sarif4k

Kotlin data bindings for the Static Analysis Results Interchange Format (SARIF)
Apache License 2.0
15 stars 7 forks source link

Allow to add arbitrary values to `PropertyBag` #101

Closed BraisGabin closed 4 months ago

BraisGabin commented 4 months ago

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: https://github.com/Kotlin/kotlinx.serialization/issues/296 so I needed to create those chunky functions. They are not bullet proof but they should do the job.

BraisGabin commented 4 months ago

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.

BraisGabin commented 4 months ago

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

No need to apology! This review was great :)

BraisGabin commented 4 months ago

Ok, I think that now it's ready