Since forward slashes can only occur in strings inside a JSON serialized object and are not escaped (in the default settings), using
json.dump(some_dict).replace('/', r'\/')
reliably works, but it looks hacky.
I know that forward slashes don't have to be escaped, but you may escape them, and for my usecase I'd like to have them escaped.
Is there a way to to let the JSONEncoder escape forward slashes without manually escaping them?