IDEA: assertk-json extension library #348
Replies: 5 comments
-
Seems like a good idea. We've been planning an android extension lib in a similar vein for a while, but haven't had the time for it. If you want to work on it, I'd be glad to help review the design. |
Beta Was this translation helpful? Give feedback.
-
One thing to note: right now assertk is multiplatform and it would be cool for a json artifact to be as well. But the libs you linked to are java only. Re-implementing in kotlin would be a fair bit of work though if those don't already exist so understand if you wouldn't want to go down that route. |
Beta Was this translation helpful? Give feedback.
-
i wasn't aware of the fact that assertk is multiplatform, until my first PR ;) very sophisticated, nice job. and yes, you are right, it seems a bit much to re-implement a proper json assertion functionality from scratch... have to check the licenses and maybe just copy'n'paste the relevant stuff might be enough?! how about "to help review the design"? where can i be of support exactly? |
Beta Was this translation helpful? Give feedback.
-
I meant I can help review prs/help with any discussions on what the api should look like, if you were interested in implementing this feature. |
Beta Was this translation helpful? Give feedback.
-
I also needed json assertions. So while json assertion is not implemented in assertk core, I would like to share my assertk-jvm-json extension for JVM platform https://github.com/themichailov/assertk-jvm-json. |
Beta Was this translation helpful? Give feedback.
-
hi, very often i am in need of testing some JSON response, whereas i don't care about whitespace and ordering of keys within the JSON (semantic comparison).
there is the JSONAssert library, which can do that. and sometimes i need to "dig into" the JSON, which can be done with json-path.
e.g. transforming
JSONAssert.assertEquals(expectedJson, actualJson, jsontMode)
intofun Assert<String>.isJsonEquals(expectedJson: String, mode: JsonMode = JsonMode.Strict)
my idea would be to create another artifact, depending on the "assertk-core" library, and simply adding a transitive dependency with such a thin layer making the libs reusable via the fluent assertk assertions.
WDTY?
Beta Was this translation helpful? Give feedback.
All reactions