Title:
[ANeff] ER for: DeserializeJSON() support for .toJSON()'s serializeQueryByColumns="struct"
| View in TrackerStatus/Resolution/Reason: To Fix//BugVerified
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff ()
Created: 02/08/2017
Components: Language, Serialization
Versions: 2016
Failure Type: Others
Found In Build/Fixed In Build: CF2016 HF3 /
Priority/Frequency: Normal /
Locale/System: /
Vote Count: 0
This ER is for DeserializeJSON(q, "query"), to support .toJSON()'s serializeQueryByColumns="struct"
Repro:
<cfscript>
q = queryNew("col1,col2,col3", "varchar,double,integer", [[1,1.0,1],[2,2.0,2]]);
j = q.toJSON("struct", false);//returns [{"COL1":"1","COL2":1.0,"COL3":1},{"COL1":"2","COL2":2.0,"COL3":2}]
q2 = deserializeJSON(j, false);
writeDump(q2);
</cfscript>
Actual Result: an array of structs (understandable.. but.. we need a way to force an array-of-structs to query..)
Suggestion:
<cfscript>
q = queryNew("col1,col2,col3", "varchar,double,integer", [[1,1.0,1],[2,2.0,2]]);
j = q.toJSON("struct", false);//returns [{"COL1":"1","COL2":1.0,"COL3":1},{"COL1":"2","COL2":2.0,"COL3":2}]
q2 = deserializeJSON(j, "query");
writeDump(q2);
</cfscript>
Actual Result: exception
Expected Result: If input is an array of structs, then return a query. Otherwise, throw an exception.
Attachments:
Comments: