jhthorsen / json-validator

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

Question: When using Coercion is it intended to alter the type of the original data? #153

Closed code4pay closed 5 years ago

code4pay commented 5 years ago

I just want to check as this seems to have changed from the 2.x versions. If I set Coercion on is it intended that it should be altering the original data? Seems to be the case with v3.06 with numbers which suites our use case fine but I just want to check it is not a bug before relying on it.

jhthorsen commented 5 years ago

The reason why it didn't change data (all the time) before was because there was a bug that prevented coercion from working in all cases.

But the answer is yes. It's intended to change the internal representation of the data in Perl.

I think we should alter the title of this issue though, since it sounds like it's changing the data, while it's just changing the type of the data, right..?

code4pay commented 5 years ago

Thanks, Updated the Title, this suits us perfectly thanks.