Sha256: 0663c61ce9ad04380cb4a2df906137d13c09ba8c845aa732a4b9a1a828096909

Contents?: true

Size: 403 Bytes

Versions: 9

Compression:

Stored size: 403 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, 'application/xml'
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
grape-1.5.2 lib/grape/parser/xml.rb
grape-1.5.1 lib/grape/parser/xml.rb
grape-1.5.0 lib/grape/parser/xml.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/grape-1.4.0/lib/grape/parser/xml.rb
grape-1.4.0 lib/grape/parser/xml.rb
grape-1.3.3 lib/grape/parser/xml.rb
grape-1.3.2 lib/grape/parser/xml.rb
grape-1.3.1 lib/grape/parser/xml.rb
grape-1.3.0 lib/grape/parser/xml.rb