File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ class << self
6161 # @return [Boolean]
6262 def primitive? ( input )
6363 case input
64- in true | false | Integer | Float | Symbol | String
64+ in true | false | Numeric | Symbol | String
6565 true
6666 else
6767 false
@@ -504,7 +504,7 @@ class << self
504504 def encode_content ( headers , body )
505505 content_type = headers [ "content-type" ]
506506 case [ content_type , body ]
507- in [ %r{^application/(?:vnd\. api\+ )?json} , Hash | Array ]
507+ in [ %r{^application/(?:vnd\. api\+ )?json} , _ ] unless body . nil?
508508 [ headers , JSON . fast_generate ( body ) ]
509509 in [ %r{^application/(?:x-)?jsonl} , Enumerable ]
510510 [ headers , body . lazy . map { JSON . fast_generate ( _1 ) } ]
@@ -516,6 +516,8 @@ def encode_content(headers, body)
516516 [ headers , body . tap ( &:rewind ) ]
517517 in [ _ , StringIO ]
518518 [ headers , body . string ]
519+ in [ _ , Symbol | Numeric ]
520+ [ headers , body . to_s ]
519521 else
520522 [ headers , body ]
521523 end
You can’t perform that action at this time.
0 commit comments