Skip to content

Commit 2fda57c

Browse files
committed
JSON Parse if base type; num, str, null, boolean
1 parent 7349a8d commit 2fda57c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |g|
22
g.name = 'lib'
3-
g.version = '2.0.0'
3+
g.version = '2.0.1'
44
g.date = Date.today.to_s
55
g.summary = "StdLib: Standard Library for Microservices Ruby Bindings"
66
g.description = "StdLib: Standard Library for Microservices Ruby Bindings"

lib/lib.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def exec!(*args)
159159
if contentType === 'application/json' then
160160
response = response.to_s
161161
begin
162-
response = JSON.parse(response);
162+
response = ('{['.include? response[0]) ? JSON.parse(response) : JSON.parse("[#{response}]")[0]
163163
rescue
164164
response = nil
165165
end

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy