diff --git a/CHANGELOG.md b/CHANGELOG.md index 98b796c..5cb5463 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ #### Fixes * Your contribution here. +* [#404](https://github.com/ruby-grape/grape-entity/pull/404): Drop `MultiJson` dependency, use `Hash#to_json` for ActiveSupport-aware serialization - [@numbata](https://github.com/numbata). ### 1.0.4 (2026-04-17) diff --git a/grape-entity.gemspec b/grape-entity.gemspec index 5b158df..b6b882b 100644 --- a/grape-entity.gemspec +++ b/grape-entity.gemspec @@ -25,7 +25,6 @@ Gem::Specification.new do |s| s.required_ruby_version = '>= 3.0' s.add_dependency 'activesupport', '>= 3.0.0' - s.add_dependency 'multi_json', '>= 1.0' s.files = Dir['lib/**/*.rb', 'CHANGELOG.md', 'LICENSE', 'README.md'] s.require_paths = ['lib'] diff --git a/lib/grape_entity/entity.rb b/lib/grape_entity/entity.rb index cd14033..bd36d20 100644 --- a/lib/grape_entity/entity.rb +++ b/lib/grape_entity/entity.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'multi_json' - module Grape # An Entity is a lightweight structure that allows you to easily # represent data from your application in a consistent and abstracted @@ -594,7 +592,7 @@ def is_defined_in_entity?(attribute) def to_json(options = {}) options = options.to_h if options&.respond_to?(:to_h) - MultiJson.dump(serializable_hash(options)) + serializable_hash(options).to_json end def to_xml(options = {})