mysql_json icon indicating copy to clipboard operation
mysql_json copied to clipboard

add a function json_valid which returns true if the argument is valid json

Open db48x opened this issue 11 years ago • 1 comments

I found that my queries were incomplete unless I could differentiate between an invalid object and an object that didn't have the property I was looking for.

The code could probably be simplified; I welcome any feedback you may have.

db48x avatar Mar 01 '14 12:03 db48x

Sorry for not responding. It would be great if you could take the approach described below instead of copying the code.

  • convert and rename json_get to an internal function that returns both the result and error message
  • json_get and json_is_valid (personally I prefer functions returning booleans be prefixed with is) should be a wrapper function calling the internal function

kazuho avatar Apr 09 '14 02:04 kazuho