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

Empty string passed Check validation. #25

Open
mnabarro opened this issue Jun 20, 2024 · 3 comments
Open

Empty string passed Check validation. #25

mnabarro opened this issue Jun 20, 2024 · 3 comments

Comments

@mnabarro
Copy link

Hi! Thanks for this project. I'm using it to validate json files and an empty string passes validation and I think it should not.

@hydrobyte
Copy link
Owner

Hi,

Thanks for your feedback.

See, empty values are valid as in {"k":""}.

Also, empty keys are valid like this: {"":"v"}.

See JSON Lint as reference.

Regards,

Marcelo.

@mnabarro
Copy link
Author

mnabarro commented Jun 20, 2024

Thanks you for your quick response. I know that empty strings are valid as keys or values but, what I was trying to say is that, if you pass an empty string to validate ( i.e. check('') ) it returns true and it should return false, just like JSON Lint does if you simply click on the [Validate JSON] button without any text in the textarea.

Best regards.

@hydrobyte
Copy link
Owner

hydrobyte commented Jun 21, 2024

Oh, Now I got it.
It is simple to implement.
Meanwhile, you can check strings that are not empty, right? :-)
I'll share it in next update.
Best.

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

No branches or pull requests

2 participants