Skip to content

Commit

Permalink
support :symbolize_keys options for json parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
colinsurprenant authored and jordansissel committed Sep 27, 2014
1 parent a78f6ba commit d2f6118
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/logstash/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class GeneratorError < LogStash::Error; end

### MRI

def mri_load(data)
def mri_load(data, options = {})
Oj.load(data)
rescue Oj::ParseError => e
raise LogStash::Json::ParserError.new(e.message)
Expand All @@ -31,8 +31,8 @@ def mri_dump(o)

### JRuby

def jruby_load(data)
JrJackson::Raw.parse_raw(data)
def jruby_load(data, options = {})
options[:symbolize_keys] ? JrJackson::Raw.parse_sym(data) : JrJackson::Raw.parse_raw(data)
rescue JrJackson::ParseError => e
raise LogStash::Json::ParserError.new(e.message)
end
Expand Down

0 comments on commit d2f6118

Please sign in to comment.