SerializeJSON() doesn't include ORM keys that have NULL values while it's not the case for Query

Description

Table structure:

SerializeJSON(EntityLoad("Test")) will output:


Column Name is missing from the result JSON string.

While SerializeJSON(QueryExecute("select * from Table")) will output:

It bugs me when building UI one has to write extra code to detect the existence of the key.

The inconsistency should be fixed.


Reproduction code

Environment

Lucee 5.2.4.37(Mac OS X 10.12.6)

Activity

Show:
Pothys - MitrahSoft
November 1, 2017, 7:24 AM

I've added test case for this ticket & confirmed the issue happened on latest version of lucee 5.2.5.20 snapshot. SerializeJSON() doesn't Serialize the ORMkey having NULL values.

Pull Request: https://github.com/lucee/Lucee/pull/331

Christian Hofstätter
December 12, 2018, 1:25 PM

I wouldn't call this a "Minor" bug...

Da Li
June 8, 2019, 1:44 PM

I agree with Christian. The consistency issue should be addressed soon.

Assignee

Michael Offner

Reporter

Da Li

Priority

Critical

Labels

Fix versions

None

Affects versions