hydrobyte / McJSON

A Delphi / Lazarus / C++Builder simple and small class for fast JSON parsing.
MIT License
58 stars 20 forks source link

Empty string passed Check validation. #25

Closed mnabarro closed 1 week ago

mnabarro commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 trueand 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 commented 3 months ago

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.

hydrobyte commented 1 week ago

Done! Sorry for the delay.