Sha256: 3a393514b922a83d2c20d2dc9ec6d371c29b91928c4179fe0b6d65e082542a95
Contents?: true
Size: 396 Bytes
Versions: 7
Compression:
Stored size: 396 Bytes
Contents
API_JSON = 'application/vnd.api+json'.freeze Mime::Type.register(API_JSON, :jsonapi) parsers = ActionDispatch::Request.parameter_parsers.merge( Mime[:jsonapi].symbol => ->(body) { JSON.parse(body) } ) ActionDispatch::Request.parameter_parsers = parsers ActionController::Renderers.add :jsonapi do |obj, _options| self.content_type ||= Mime[:jsonapi] self.response_body = obj.to_json end
Version data entries
7 entries across 7 versions & 1 rubygems