Module: Grape::Parser::Xml

Defined in:
lib/grape/parser/xml.rb

Class Method Summary collapse

Class Method Details

.call(object, _env) ⇒ Object


5
6
7
8
9
10
# File 'lib/grape/parser/xml.rb', line 5

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