Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

db48x
Copy link

@db48x db48x commented Mar 1, 2014

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.

@kazuho
Copy link
Owner

kazuho commented Apr 9, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants