Sha256: 29a2a520c38077a6eb4966ee5ddb9961bf67c4c9f39ba8cd05e1157bdc06b253

Contents?: true

Size: 407 Bytes

Versions: 13

Compression:

Stored size: 407 Bytes

Contents

# frozen_string_literal: true

module Grape
  module Parser
    module Xml
      class << self
        def call(object, _env)
          ::Grape::Xml.parse(object)
        rescue ::Grape::Xml::ParseError
          # handle XML parsing errors via the rescue handlers or provide error message
          raise Grape::Exceptions::InvalidMessageBody.new('application/xml')
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
grape-2.2.0 lib/grape/parser/xml.rb
grape-2.1.3 lib/grape/parser/xml.rb
grape-2.1.2 lib/grape/parser/xml.rb
grape-2.1.1 lib/grape/parser/xml.rb
grape-2.1.0 lib/grape/parser/xml.rb
grape-2.0.0 lib/grape/parser/xml.rb
grape-1.8.0 lib/grape/parser/xml.rb
grape-1.7.1 lib/grape/parser/xml.rb
grape-1.7.0 lib/grape/parser/xml.rb
grape-1.6.2 lib/grape/parser/xml.rb
grape-1.6.1 lib/grape/parser/xml.rb
grape-1.6.0 lib/grape/parser/xml.rb
grape-1.5.3 lib/grape/parser/xml.rb