Structural JSON Matching
Shows partial object matching, unordered array membership, and unordered array subset matching.
---
Get User
GET https://lorem-api.com/api/user/abc1234
# Matches nested user fields
^ & body ~= {"id":"abc1234","email":"Kristoffer_Lindgren@hotmail.com"}
# Matches the user subset
^ & body ~= {"name":"George Mann I"}
---
Get Posts
GET https://lorem-api.com/api/articles
? count = 2
? seed = 1234
# Contains a matching article object
^ & body ~= {"slug":"astrum-cavus-adulatio"}
# Contains the expected article subset
^ & body ~= [{"slug":"astrum-cavus-adulatio"},{"slug":"consequatur-decimus-centum"}]