Closed nadar closed 4 years ago
Thanks for idea but I don't think it fits.
false
for "test"
or 42
that is valid JSON.\JsonException
anyway when decoding.What your are talking about is this i assume: https://stackoverflow.com/a/7487892/4611030
But in 99% percent of the situations the method could help developers when dealing with JSON. So maybe make a good example how people can ensure that behavior with this package with try catch blocks.
(ps: maybe its also just my personal taste of what i expected from such a library: methods which helps me to find solutions for problems right at my fingertips...)
It is likely that I'm not getting the problem and how this helper method solves it.
We have a very convenient method to check whether an input is already a json value:
https://github.com/luyadev/luya/blob/master/core/helpers/Json.php#L19-L49
If this sounds interesting for this package, i would make a PR.