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

Regex check in Raisin::Entity flags numbers as strings for JSON::XS #114

Open
m-dango opened this issue Oct 22, 2021 · 0 comments
Open

Regex check in Raisin::Entity flags numbers as strings for JSON::XS #114

m-dango opened this issue Oct 22, 2021 · 0 comments

Comments

@m-dango
Copy link

m-dango commented Oct 22, 2021

Raisin::Entity::_compile_column contains the following check on an entity runtime return value:

$retval && !ref($retval) && $retval =~ /^Raisin::Entity::Nested::/

The checks on $retval unfortunately means that any non-zero value returned as a number from the runtime will be output as a string in JSON, due to the regex, if the user happens to be using JSON::XS.

Raisin example:
https://replit.com/@m-dango/RaisinNumericString#main.pl

Comparing resulting JSON across different modules:
https://replit.com/@m-dango/jsonNumberRegex#main.pl

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

1 participant