Skip to content

Boolean true/false Incorrectly Being Converted to Strings #10

Description

@JamoCA

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions