Lucee V6 vs V5 breaking change

In Version 5 this code will just return a blank string, in V6.0.0-SNAPSHOT+313 it returns “Invalid call of the function [DeserializeJSON], first Argument [JSONVar] is invalid, input value cannot be empty string.”

<cfscript>
  json = "";
  dump(deserializeJSON(json))
</cfscript>

I’d expect that code to throw an error. There is no way that an empty string is a valid JSON. Thus, it should throw an error. I’d rather file a bug for version 5 for not throwing an error in that code.

Ok I get what you are saying, but it is a breaking change and I would expect backward compatibility personally.

If this is expected behavior, then it should be noted somewhere.

Using that logic, no bug could ever be fixed because - implicitly - a bug fix changes behaviour in a breaking fashion.

And the bugfix is noted somewhere: [LDEV-3413] - Lucee.

1 Like

added a breaking change flag

General rule, If you are working with SNAPSHOTs before a release, you always need to check jira

I’ve added an epic with Lucee 6.0 proposed and implemented breaking changes

1 Like

This is true. I guess for me the issue was that this has been like this for years and years, and at some point a bug becomes a feature right? :slight_smile:

As long as it is noted I am fine with fixing on my side. TBH, not why my team didn’t validate that it is JSON before passing it to be deserialize.

2 Likes

fail early, fail fast is my motto

Yeah, there’s a lot of “happy-path-only” code out there. So yer not alone in that regard.

Very true. We fight the good fight and for sure do our best to think of that stuff. But you know how it is.

1 Like