Home > other >  [Lua] cjson didn't provide the interface format to check?
[Lua] cjson didn't provide the interface format to check?

Time:01-14

. I need to use cjson decode to parse the json string, but the upper often pass some of the json format string, such as a string of HTML text, returns an empty string, a 404
Then use cjson decode to parse the string, will be an error,
Expected value but found T_END at character 1

Since there will be an error, that I think it should have an elegant way to filter out all the unreasonable input data, but I checked the GIT, and output the cjson this table, don't see any format check interface,

Excuse me, is this really didn't do this way? If not, is there anyone who can provide a json format check lua code
  • Related