Sha256: 44072f974b22555129dc4a30582c497f55c9adc1a32014489893ad9d68aaab08
Contents?: true
Size: 402 Bytes
Versions: 9
Compression:
Stored size: 402 Bytes
Contents
# Add a formatter to grape that converts all snake case hash keys from ruby to camel case. module IntrospectiveGrape module Formatter module CamelJson def self.call(object, _env) if object.respond_to?(:to_json) JSON.parse(object.to_json).with_camel_keys.to_json else MultiJson.dump(object).with_camel_keys.to_json end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems