isList handling

This commit is contained in:
2021-11-30 19:09:22 +01:00
parent 2a3910a7cf
commit 8519da26a8
3 changed files with 47 additions and 11 deletions

View File

@ -98,7 +98,7 @@ FROM $types[$operation['resultType']['apiName']]['sqlName']#slurp
#else
$operation['statement']#slurp
#end if
", #slurp
", $operation['isList'], #slurp
#if $operation['bodyInputType']
$operation['bodyInputType']['apiName']#slurp
#elif $operation['paramInputTypes']
@ -107,7 +107,11 @@ paramInput#slurp
null#slurp
#end if
);
return new ObjectResult(res);
return new ObjectResult(res#slurp
#if $operation['isList']
[0]#slurp
#end if
);
} catch (NotDataFoundException) {
return StatusCode(404, "No $operation['resultType']['apiName'] element found");
}