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 = {})
4949 def self . load ( string , options = { } )
5050 if defined? MultiJson
5151 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
5353 # numbers as floats rather than BigDecimals, which are serialized as
5454 # strings by the built-in JSON gem and therefore can cause schema errors,
5555 # for example, when we are rendering reports to JSON using `to_pson` in
5656 # PuppetDB.
57- if MultiJson . adapter . name == "MultiJson::Adapters::JrJackson"
57+ case MultiJson . adapter . name
58+ when "MultiJson::Adapters::JrJackson"
5859 options [ :use_bigdecimal ] = false
60+ when "MultiJson::Adapters::Oj"
61+ options [ :bigdecimal_load ] = :float
5962 end
6063
6164 MultiJson . load ( string , options )
You can’t perform that action at this time.
0 commit comments