serializeJSON with "struct" is changing key case to upper

Description

Hi,

While updating the Lucee server from 5.2 to 5.3, I found an issue with serializeJSON function. In the latest version, it changed the key case to uppercase when passed "struct" as second arguments.

variables.qEmpls = queryNew('employeeId, employeeName', 'integer, varchar'); queryAddRow(variables.qEmpls, 1); querySetCell(variables.qEmpls, 'employeeId', 1); querySetCell(variables.qEmpls, 'employeeName', 'Bharat'); queryAddRow(variables.qEmpls, 1); querySetCell(variables.qEmpls, 'employeeId', 2); querySetCell(variables.qEmpls, 'employeeName', 'Naresh'); dump(serializeJSON(variables.qEmpls, "struct"))

Version: 5.2.9.31 [maintain case]

[{"employeeId":1,"EMPLOYEENAME":"Bharat"},{"employeeId":2,"EMPLOYEENAME":"Naresh"}]

Version: 5.3.2.77 [change case to upper]

[{"EMPLOYEEID":1,"EMPLOYEENAME":"Bharat"},{"EMPLOYEEID":2,"EMPLOYEENAME":"Naresh"}]

Am I miss anything?

Thanks,
Bharat

Attachments

1

Activity

Bharat Patel 
12 July 2022 at 04:31

It seems working with latest version. thanks for looking on this.

Pothys - MitrahSoft 
11 July 2022 at 10:24

I've checked this ticket with the lucee latest version 5.3.10.28-SNAPSHOT. Now the issue was solved. Can you please check the issue with lucee latest version and report here back?

Pothys - MitrahSoft 
10 March 2020 at 13:56

I've checked this ticket with the latest version 5.3.6.13-SNAPSHOT. If we use preserveCaseForQueryColumn for this issue, it will work as per the settings.
But, lucee doesn't consider the key case settings for serializeJSON(query, "struct") as a structure.
Micha will confirm for about this issue.

Bharat Patel 
4 October 2019 at 11:35

Thanks for letting me know about this setting. I mainly used a stable version on the development to check my application function and after certain time I do update on production.

I’ve applied the setting and it works as expected. It is always nice to make the product compatible with expected behavior. But for this change, since it will break my application, I personally don’t like to apply this setting.

It looks like breaking change so I wish to restore previous functionality.

Can someone please move this on LDEV and look furthermore?

Tim Smolders 
4 October 2019 at 09:42
(edited)

Tested serializeJSON(query) with and without “struct” notation on Lucee 5.3.3.62: I can confirm that KEY CASE settings are not being respected.
It would be nice if casing settings where consistently adhered to.

Please see https://luceeserver.atlassian.net/browse/LDEV-2304 , I believe this issue will be fixed in 5.3.4.6

It seems you can finetune behavior withthis.serialization.preserveCaseForQueryColumn=true;

Unresolved

Details

Assignee

Reporter

Labels

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Fix versions

Priority

Created 1 October 2019 at 09:59
Updated 12 July 2022 at 13:43