media_types-serialization 1.0.1 → 1.0.2

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: 262dba633b56ee02980cb04a7e768198451963a71885c50bc35fafb4744c7ecd
4
- data.tar.gz: 29f99b4a875081f23e4fd583e9adf0a99cf9250c597c5c5d553d4da224540416
3
+ metadata.gz: 129d55b60f1d39859d01d1bdf4981f6463feb3a63ddb258e073ec472d566d2b2
4
+ data.tar.gz: 4b04a87f78d765f68073ecb89d9a1bb64b2b111beb3743dddf26184ea25c65d1
5
5
  SHA512:
6
- metadata.gz: 61f10719fe7b7741323b119ede580f0ac2c003c77f28201d62c9c43a0149b415193974df028539cb2f47286dcfdeace81749740c9a9a228037d888fd47d0a2e9
7
- data.tar.gz: 85578dcb19c073cacdd78714c4976dd3ebb1b87438e5e5036b82a3623dc8477a1a3e8c8ab6ea55aa79d50e71ec659e8c69029f7e037519610f97126f2f5949c7
6
+ metadata.gz: 33a37e3f6343069fca0c3fb82953b008ed427ff86c5c411969a3ab79f87dd8c31c2881d405baac4fac1ffca55ec0169ac741fafd79839156629bb3737b9ce3da
7
+ data.tar.gz: dd4324afe7d9715d29d5d21bdc329c1a21f9b0435048bef4e39cbdbd80bbeb1a6570674cba562759240368b3f7f534d712a8991e3047bfe2f538501dce6e4254
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.2
4
+
5
+ - 🐛 Explicitly set all oj parameters when decoding as well.
6
+
3
7
  ## 1.0.1
4
8
 
5
9
  - 🐛 Explicitly set all oj and json parameters to ensure correct behavior with changed defaults.
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![Gem Version](https://badge.fury.io/rb/media_types-serialization.svg)](https://badge.fury.io/rb/media_types-serialization)
5
5
  [![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
6
6
 
7
- `respond_to` on steroids. Add versioned serialization and deserialization to your rails projects.
7
+ `respond_to` on steroids. Add versioned serialization and deserialization to your Rails projects.
8
8
 
9
9
  ## Installation
10
10
 
@@ -531,9 +531,7 @@ Custom attributes can be added using the `p.attribute(name, value)` function.
531
531
 
532
532
  ### Related
533
533
 
534
- - [`MediaTypes`](https://github.com/SleeplessByte/media-types-ruby): :gem: Library to create media type definitions, schemes and validations
535
- - [`MediaTypes::Deserialization`](https://github.com/XPBytes/media_types-deserialization): :cyclone: Add media types supported deserialization using your favourite parser, and media type validation.
536
- - [`MediaTypes::Validation`](https://github.com/XPBytes/media_types-validation): :heavy_exclamation_mark: Response validations according to a media-type
534
+ - [`MediaTypes`](https://github.com/SleeplessByte/media-types-ruby): :gem: Library to create media type validators.
537
535
 
538
536
  ## API
539
537
 
@@ -67,7 +67,21 @@ module MediaTypes
67
67
  quirks_mode: false
68
68
  )
69
69
  }
70
- self.json_decoder = Oj.method(:load)
70
+ self.json_decoder = ->(obj) {
71
+ Oj.load(obj,
72
+ mode: :compat,
73
+ ascii_only: false,
74
+ allow_nan: false,
75
+ symbol_keys: true,
76
+ allow_nil: false,
77
+ allow_invalid_unicode: false,
78
+ array_class: ::Array,
79
+ create_additions: false,
80
+ hash_class: ::Hash,
81
+ nilnil: false,
82
+ quirks_mode: false
83
+ )
84
+ }
71
85
  else
72
86
  require 'json'
73
87
  self.json_encoder = JSON.method(:pretty_generate)
@@ -1,5 +1,5 @@
1
1
  module MediaTypes
2
2
  module Serialization
3
- VERSION = '1.0.1'.freeze
3
+ VERSION = '1.0.2'.freeze
4
4
  end
5
5
  end
@@ -6,8 +6,8 @@ require 'media_types/serialization/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'media_types-serialization'
8
8
  spec.version = MediaTypes::Serialization::VERSION
9
- spec.authors = ['Derk-Jan Karrenbeld']
10
- spec.email = ['derk-jan@xpbytes.com']
9
+ spec.authors = ['Derk-Jan Karrenbeld', 'Max Maton']
10
+ spec.email = ['derk-jan@xpbytes.com', 'max@delftsolutions.nl']
11
11
 
12
12
  spec.summary = 'Add media types supported serialization using your favourite serializer'
13
13
  spec.homepage = 'https://github.com/XPBytes/media_types-serialization'
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: media_types-serialization
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derk-Jan Karrenbeld
8
+ - Max Maton
8
9
  autorequire:
9
10
  bindir: exe
10
11
  cert_chain: []
11
- date: 2020-04-15 00:00:00.000000000 Z
12
+ date: 2020-04-17 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: actionpack
@@ -179,6 +180,7 @@ dependencies:
179
180
  description:
180
181
  email:
181
182
  - derk-jan@xpbytes.com
183
+ - max@delftsolutions.nl
182
184
  executables: []
183
185
  extensions: []
184
186
  extra_rdoc_files: []