234 attempt to fix js error Uncaught SyntaxError: Unexpected identifier 'hidden'
This commit is contained in:
@@ -1,21 +1,20 @@
|
||||
<cfcomponent extends="taffy.core.baseDeserializer">
|
||||
component extends="baseDeserializer" {
|
||||
|
||||
<cffunction name="getFromJson" output="false" taffy:mime="application/json,text/json" hint="get data from json">
|
||||
<cfargument name="body" hint="the textual request body" />
|
||||
<cfset var data = 0 />
|
||||
<cfset var response = {} />
|
||||
public function getFromJson(body) output="false" taffy_mime="application/json,text/json" hint="get data from json" {
|
||||
var data = 0;
|
||||
var response = {};
|
||||
|
||||
<cfif not isJson(arguments.body)>
|
||||
<cfset throwError(msg="Input JSON is not well formed", statusCode="400") />
|
||||
</cfif>
|
||||
<cfset data = deserializeJSON(arguments.body) />
|
||||
<cfif not isStruct(data)>
|
||||
<cfset response['_body'] = data />
|
||||
<cfelse>
|
||||
<cfset response = data />
|
||||
</cfif>
|
||||
if (!isJson(arguments.body)) {
|
||||
throwError(msg="Input JSON is not well formed", statusCode="400");
|
||||
}
|
||||
data = deserializeJSON(arguments.body);
|
||||
if (!isStruct(data)) {
|
||||
response['_body'] = data;
|
||||
} else {
|
||||
response = data;
|
||||
}
|
||||
|
||||
<cfreturn response />
|
||||
</cffunction>
|
||||
return response;
|
||||
}
|
||||
|
||||
</cfcomponent>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user