B
B
beduin012018-04-26 11:52:16
Python
beduin01, 2018-04-26 11:52:16

How to properly convert a dictionary to JSON?

I need to validate data. I want to use Json Schema. However, the original data is in my dictionary. I don’t understand if I need to do some manipulations or if I can apply the scheme to the dictionary right away. Is this all necessary?

dict_data = req.params
json_data = json.loads(json.dumps(dict_data))

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question