sam
09/20/2021, 1:03 AMJim
09/20/2021, 1:05 AMsam
09/20/2021, 1:05 AMJim
09/20/2021, 1:07 AMsam
09/20/2021, 1:07 AMJim
09/20/2021, 1:07 AMsam
09/20/2021, 1:07 AMJim
09/20/2021, 1:07 AMsam
09/20/2021, 1:07 AMJim
09/20/2021, 1:08 AMEmil Kantis
09/20/2021, 12:20 PMcompareJsonOptions
is good to go otherwise, just need to update docssam
09/20/2021, 12:22 PMEmil Kantis
09/20/2021, 1:10 PMsam
09/20/2021, 1:10 PMEmil Kantis
09/20/2021, 1:10 PMsam
09/20/2021, 1:10 PMJim
09/20/2021, 4:06 PMsam
09/20/2021, 4:12 PMEmil Kantis
09/20/2021, 9:35 PMval myJson = """{ "x": [0, 1], "name": "john" }
myJson.jsonPath<Int>("$.x[1]") shouldBe 1
myJson.jsonPath<String>("$.name") shouldBe "john"
Bonus benefit is it could be used with other frameworks, or in production code if someone needs it 🙂Jim
09/20/2021, 9:44 PMEmil Kantis
09/20/2021, 9:45 PMextrakt
, cause squeezing Kt
into the name is apparently bonus points in the community 😄Jim
09/20/2021, 9:47 PMmyJson shouldSatisfy {
"$.x[1]".extrakt<Int>() shouldBe 1
"$.name".extraktString>() shouldBe "john"
}
only parse the json once, cache the paths from the parsed json paths, etc.Emil Kantis
12/04/2021, 12:49 AMJsonElement
using a json path expression. Can of course be used to test things as well.
If you want to play with it as well I can give you permissions, or if you want to do something completely different with the name I’ll go ahead and rename itJim
12/04/2021, 1:07 AM