Skip to content

Commit

Permalink
Add multi_json to dependency
Browse files Browse the repository at this point in the history
Allows others to choose their flavor of json parsing.
  • Loading branch information
warmwaffles committed Aug 8, 2016
1 parent 8a2bd30 commit 2f2eedd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions jsonapi-resources.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'pry'
spec.add_development_dependency 'concurrent-ruby-ext'
spec.add_dependency 'rails', '>= 4.0'
spec.add_dependency 'multi_json', '>= 1.0.0'
spec.add_dependency 'concurrent-ruby'
end
4 changes: 3 additions & 1 deletion lib/jsonapi/mime_types.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "multi_json"

module JSONAPI
MEDIA_TYPE = 'application/vnd.api+json'

Expand All @@ -19,7 +21,7 @@ def self.install

def self.parser
lambda do |body|
data = JSON.parse(body)
data = MultiJson.load(body)
data = {:_json => data} unless data.is_a?(Hash)
data.with_indifferent_access
end
Expand Down

0 comments on commit 2f2eedd

Please sign in to comment.