upd(all): parse uint64 from post arrays
This commit is contained in:
@@ -76,6 +76,7 @@ usort($apis, function($a, $b) {
|
||||
|
||||
$parsers = array(
|
||||
"uint64" => "parseUInt64",
|
||||
"[]uint64" => "parseUInt64A",
|
||||
"int" => "parseInt",
|
||||
"bool" => "parseBool",
|
||||
"types.JSONText" => "parseJSONText",
|
||||
|
||||
@@ -63,6 +63,8 @@ func ({self} *{name|expose}{call.name|capitalize}) Fill(r *http.Request) (err er
|
||||
{foreach $params as $param}
|
||||
{if strtolower($method) === "path"}
|
||||
{self}.{param.name|expose} = {if ($param.type !== "string")}{$parsers[$param.type]}({/if}chi.URLParam(r, "{param.name}"){if ($param.type !== "string")}){/if}
|
||||
{elseif substr($param.type, 0, 2) === '[]' && isset($parsers[$param.type])}
|
||||
{self}.{param.name|expose} = {$parsers[$param.type]}({if $method === "post"}r.Form["{param.name}"]{else}urlQuery["{param.name}"]{/if})
|
||||
{elseif $param.type === "*multipart.FileHeader"}
|
||||
if _, {self}.{param.name|expose}, err = r.FormFile("{$param.name}"); err != nil {
|
||||
return errors.Wrap(err, "error procesing uploaded file")
|
||||
|
||||
Reference in New Issue
Block a user