You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had an issue regarding trying to match JSON payloads with a mocked response even though the keys/values matched exactly. In my search for figuring out why it wasn't working, I noticed that the section in which a check for equality is sensitive to the order by which keys and values are present in the casted string.
My approach to solving this is (at least for JSON) is to convert the byte bodies into a map[string]interface{} and check equality using reflect.DeepEqual(x,y).
I will open a PR shortly with my suggested fixes. I'd like to merge this into master if possible, please let me know if you have any suggestions on how to implement this better.
Hello,
I had an issue regarding trying to match JSON payloads with a mocked response even though the keys/values matched exactly. In my search for figuring out why it wasn't working, I noticed that the section in which a check for equality is sensitive to the order by which keys and values are present in the casted string.
My approach to solving this is (at least for JSON) is to convert the byte bodies into a
map[string]interface{}
and check equality usingreflect.DeepEqual(x,y)
.I will open a PR shortly with my suggested fixes. I'd like to merge this into master if possible, please let me know if you have any suggestions on how to implement this better.
PR: #16
Thank you 👍
The text was updated successfully, but these errors were encountered: