jhthorsen / json-validator

:cop: Validate data against a JSON schema
https://metacpan.org/release/JSON-Validator
56 stars 58 forks source link

test and code-fix for issue 232 #233

Closed DrHyde closed 3 years ago

DrHyde commented 3 years ago

Summary

Tightly-scoped no warnings 'newline' in the chunk of code that tries to figure out whether something is a file or a string of JSON, to avoid unnecessarily spitting out a warning when it's a JSON string that ends in a newline.

Motivation

The warning is wrong and confusing.

References

https://github.com/mojolicious/json-validator/issues/232

abraxxa commented 3 years ago

Isn't a chomp the easier fix?

DrHyde commented 3 years ago

Errm, yes, if I'd remembered it existed :-)

jhthorsen commented 3 years ago

Thanks!