environs
environs copied to clipboard
Accept any type as default json parser value (number 2)
This is a copy of https://github.com/sloria/environs/pull/198
I finally wrote the tests. Here is also some consideration, lists and dicts should be directly considered as json (as well as null itself), but strings should always be parsed as they are not valid json.
https://stackoverflow.com/questions/7487869/is-this-simple-string-considered-valid-json
Python agrees with this definition:
import json
json.loads("{}") # works
json.loads("[]") # works
json.loads("null") # works
json.loads("string") # raises error
Hello @sloria , could you take a look?
Sorry for the looong delay here. Thanks for the PR update! Will merge and release this shortly