cfargument to accept type as JSON

Description

Hi, It wil be great if we get use json as an argument to function, the need for seriallizarion or deserialization will decrease depending upon if we only needs input t/output to to JSOn only like the below:

<cffunction name="test"> <cfargument name="stringvalue" type="JSON" default=""> <cfhttp url="hit an api"> <cfhttpapara type="body" value="#stringvalue#"> </cfhttp> </cffunction>

i know there is type="any" is avaliable, but not sure if Specying JSON will be better or not

Thanks

Activity

Show:

Zac Spitzer 5 February 2025 at 16:15

Internally, they way Lucee checks if a string is json, is to deserialize it to json and then return a boolean success.

So adding a check would still be doing the conversion and throwing away the result of a successful conversion

There is already XML as a type, so it would be consistent, adobe hasn’t added this yet either

https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-a-b/cfargument.html

Details

Assignee

Reporter

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

Affects versions

Priority

Created 15 April 2018 at 19:26
Updated 5 February 2025 at 16:22

Flag notifications