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

Boolean true/false Incorrectly Being Converted to Strings #10

Open
JamoCA opened this issue Jan 15, 2020 · 0 comments
Open

Boolean true/false Incorrectly Being Converted to Strings #10

JamoCA opened this issue Jan 15, 2020 · 0 comments

Comments

@JamoCA
Copy link

JamoCA commented Jan 15, 2020

JSONUtil has been working pretty well with ColdFusion 2016 using the strictMapping=true option, but I've noticed that boolean values (deserialized true/false values from JSON or Javacast("boolean") values in a serialized object) are converted to text strings.

Is this intentional or a bug?

I've been integrating formBuilder into some projects. It's a jQuery/Angular client-side generator that uses JSON for building, creating, validating and rendering forms. I've had to add a routine to preserve true/false boolean values from being converted to strings when serializing.

response = variables.JSONUtil.SerializeJSON(var=inputVar, strictMapping=true);
response = response.replaceAll("(?i)""true""", "true").replaceAll("(?i)""false""", "false");

Other than this issue, JSONUtil works well for me and enables JSON results in CF2016 to be more correct and consistent with CF2018.

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