Sha256: c7e9dea5c88b17457314e577dbce484d1aa916757a03e050c1cd0f49908edd2b

Contents?: true

Size: 376 Bytes

Versions: 13

Compression:

Stored size: 376 Bytes

Contents

module Grape
  module Parser
    module Json
      class << self
        def call(object, _env)
          ::Grape::Json.load(object)
        rescue ::Grape::Json::ParseError
          # handle JSON parsing errors via the rescue handlers or provide error message
          raise Grape::Exceptions::InvalidMessageBody, 'application/json'
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/grape-1.2.5/lib/grape/parser/json.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/grape-1.2.5/lib/grape/parser/json.rb
grape-1.2.5 lib/grape/parser/json.rb
grape-1.2.4 lib/grape/parser/json.rb
grape-1.2.3 lib/grape/parser/json.rb
grape-1.2.2 lib/grape/parser/json.rb
grape-1.2.1 lib/grape/parser/json.rb
grape-1.2.0 lib/grape/parser/json.rb
grape-1.1.0 lib/grape/parser/json.rb
grape-1.0.3 lib/grape/parser/json.rb
grape-1.0.2 lib/grape/parser/json.rb
grape-1.0.1 lib/grape/parser/json.rb
grape-1.0.0 lib/grape/parser/json.rb