https://kotlinlang.org logo
#atrium
Title
# atrium
k

keturn

10/15/2018, 3:29 AM
Got any handy assertion functions for comparing JSON documents?
r

robstoll

10/15/2018, 5:08 AM
Not yet, but there have been similar questions already, I'll open an issue for it
What is your opinion on unexpected data?
k

keturn

10/15/2018, 5:19 AM
for the use case I'm working on at the moment, I do want to assert that the two documents are equivalent, so unexpected data should be a fail.
r

robstoll

10/15/2018, 5:20 AM
I see, and you are looking for something like:
Copy code
assert(json).isJson(doc)
right?
k

keturn

10/15/2018, 5:21 AM
yeah
r

robstoll

10/15/2018, 5:21 AM
ok, two different use cases, I'll write that down. Thanks for your input 🙂
👍 1
What about the order of values in arrays?
The more I think about it the more I would say should be
in order
per default
k

keturn

10/15/2018, 5:56 AM
Array order is important! Object property order doesn't matter to me here, which I think is going to be the common case.
👍 1
4 Views