I am looking for a way to check if a dict is contained in another:
big = {"result": {"code": "1000", "msg" : "oh yeah"} }
small = {"result": {"code": "1000"}}
test(small, big) # should be True ( small <= big )
Since the key/pair of "result" is another dict, the previous answers in stackoverflow bellow FAIL, and do not solve the problem (they work only on simpler dicts). Also, the value could be a list. I want the answer in a general JSON model.
Python: Check if one dictionary is a subset of another larger dictionary