Don't use JSON::Type, use JSON::Any instead (#435)

This commit is contained in:
Serdar Dogruyol 2018-03-10 11:05:34 +03:00 committed by GitHub
parent 50f82f5187
commit db00ecba1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View file

@ -8,7 +8,7 @@ module Kemal
MULTIPART_FORM = "multipart/form-data"
PARTS = %w(url query body json)
# :nodoc:
alias AllParamTypes = Nil | String | Int64 | Float64 | Bool | Hash(String, JSON::Type) | Array(JSON::Type)
alias AllParamTypes = Nil | String | Int64 | Float64 | Bool | Hash(String, JSON::Any) | Array(JSON::Any)
getter files
def initialize(@request : HTTP::Request)
@ -89,7 +89,7 @@ module Kemal
case json = JSON.parse(body).raw
when Hash
json.each do |key, value|
@json[key] = value.as(AllParamTypes)
@json[key] = value.raw
end
when Array
@json["_json"] = json