Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 0 additions & 1 deletion grape-entity.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
4 changes: 1 addition & 3 deletions lib/grape_entity/entity.rb
Original file line number Diff line number Diff line change
@@ -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
Comment thread
numbata marked this conversation as resolved.
Expand Down Expand Up @@ -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 = {})
Expand Down
Loading