File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -49,13 +49,16 @@ def self.load_file(filename, options = {})
49
49
def self . load ( string , options = { } )
50
50
if defined? MultiJson
51
51
begin
52
- # This ensures that JrJackson will parse very large or very small
52
+ # This ensures that JrJackson and Oj will parse very large or very small
53
53
# numbers as floats rather than BigDecimals, which are serialized as
54
54
# strings by the built-in JSON gem and therefore can cause schema errors,
55
55
# for example, when we are rendering reports to JSON using `to_pson` in
56
56
# PuppetDB.
57
- if MultiJson . adapter . name == "MultiJson::Adapters::JrJackson"
57
+ case MultiJson . adapter . name
58
+ when "MultiJson::Adapters::JrJackson"
58
59
options [ :use_bigdecimal ] = false
60
+ when "MultiJson::Adapters::Oj"
61
+ options [ :bigdecimal_load ] = :float
59
62
end
60
63
61
64
MultiJson . load ( string , options )
You can’t perform that action at this time.
0 commit comments