oj_serializers 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a055b7489622b5fcc884399410af78d536d8e03750cecdebe5535e2fd46d3d6
4
- data.tar.gz: 61a1c9852a57dd3d367f22015018a9397759bb3c3a313f1f8d32ce7093e7eb34
3
+ metadata.gz: 8bbb93696ca1b7eb5e3daac8a7a8eaaf2d66331733ae170a6d2d64f15520a0b7
4
+ data.tar.gz: 9356aad11f17a314aa66d7c99d6428b116ae0d7fcd8e36400b27175e428ab6f0
5
5
  SHA512:
6
- metadata.gz: '02887512f4deac20d0a3a6d8d14718539db2baa44fffe3ee273a2b2fdf39312c717f1b62ca75006b1fa32dc16ef38a20e59e05725ba33ddb75c0b0cab498b2f8'
7
- data.tar.gz: c4451e1a5e1f7f4b9d1b1d17696cc2559114946e220103b6e1c0546ab3198483f9e22e85ba3ed78845265ead0fed97a4fb78e2ed663d2ca6b0485efecabf9667
6
+ metadata.gz: 6dab9b921059a3ecc572f58ada7eca96e21c3cfed14ebd7ddc50ba5cd75631aa4621da1402e578b0239908c2268795b6cb449c8c4b41adf590426fc9e3c2b563
7
+ data.tar.gz: 4f68ba68ad0ee15585eff8150b87fc448931b3a2aab2aa55bc3aee7d6ca9800851fa46d94b6d20c27012e3f89829e19b979cbec8d993554039a7857f2e105468
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## Oj Serializers 3.0.1 (2026-07-17)
2
+
3
+ ### Fixes 🐞
4
+
5
+ - Enable `use_raw_json` before `Oj.optimize_rails` so `JsonValue` is not double-encoded on Rails 8.1+.
6
+
1
7
  ## Oj Serializers 3.0.0 (2026-01-02)
2
8
 
3
9
  ### Features ✨
@@ -4,10 +4,16 @@ require 'oj'
4
4
 
5
5
  # NOTE: We automatically set the necessary configuration unless it had been
6
6
  # explicitly set beforehand.
7
+ #
8
+ # `use_raw_json` must be enabled *before* `Oj.optimize_rails`. Rails 8.1
9
+ # memoizes an option-less encoder when the JSON encoder is assigned (which
10
+ # `Oj.optimize_rails` does), and `Oj::Rails::Encoder` captures `default_options`
11
+ # at construction. Enabling `use_raw_json` afterwards leaves that memoized
12
+ # encoder with `use_raw_json: false`, which double-encodes `JsonValue`.
7
13
  unless Oj.default_options[:use_raw_json]
8
14
  require 'rails'
9
- Oj.optimize_rails
10
15
  Oj.default_options = { mode: :rails, use_raw_json: true }
16
+ Oj.optimize_rails
11
17
  end
12
18
 
13
19
  # NOTE: Add an optimization to make it easier to work with a StringWriter
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OjSerializers
4
- VERSION = '3.0.0'
4
+ VERSION = '3.0.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oj_serializers
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maximo Mussini