jsonapi_parameters 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 140d60d07ed8488d9009e2c0e0757b1fbcf14596d79dc552c48c9212980985fd
4
- data.tar.gz: 3480f41f044a29d8d2db32aa64ab10af535997fa5cb772ca1080372abb798e4c
3
+ metadata.gz: f3245b44f39068e448c0acbf8ad822ebe3891133cfde009c4b6411d3b9a50f1b
4
+ data.tar.gz: cfc79502f187a3f9453f9b3ba952128e00114a7cc47ea5aaf6047ba5484c49cc
5
5
  SHA512:
6
- metadata.gz: 8accb91454be6e686e29b4fbee76e9185df0dc2689ac50292d8098fa4f42fff9f4f8059a7c33aa389455776b7dcf8eb081ed0f472ef1e3fcd19a358f9875dac4
7
- data.tar.gz: 39600f7081909c9bd5be6a16694e9db09f70b53e1e8d8126fa41fcacc9666232f68d1e16196993213cb943e7875fde0308ade0dfec889a625f254ff117ef2ad8
6
+ metadata.gz: 1f2504172943defbcd2bfbd86eca1134ca2da0193f6f89e0f315ba931372864b545e9005266251982c0e6b167e004a8202a1ca95954837b1b1796e7f4148897b
7
+ data.tar.gz: f13ad5d8f443e1cd010c133152b50791d876c44b32385d4009318b94e4f29c437d55a02882737bc57237d171e68f8f1802d52976596d13bd0cf60167cc9403ea
data/README.md CHANGED
@@ -99,6 +99,12 @@ If the input is in a different convention than `:snake`, you should specify that
99
99
 
100
100
  * by a global setting: `JsonApi::Parameters.ensure_underscore_translation = true`
101
101
  * while calling `.jsonapify`, for instance: `.jsonapify(params, naming_convention: :camel)`. **The value does not really matter, as anything different than `:snake` will result in deep keys transformation provided by [ActiveSupport](https://apidock.com/rails/v4.1.8/Hash/deep_transform_keys).**
102
+
103
+ ## Mime Type
104
+
105
+ As [stated in the JSON:API specification](https://jsonapi.org/#mime-types) correct mime type for JSON:API input should be [`application/vnd.api+json`](http://www.iana.org/assignments/media-types/application/vnd.api+json).
106
+
107
+ This gems intention is to make input consumption as easy as possible. Hence, it [registers this mime type for you](lib/jsonapi_parameters/core_ext/action_dispatch/http/mime_type.rb).
102
108
 
103
109
  ## License
104
110
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -1 +1,2 @@
1
1
  require_relative 'core_ext/action_controller/parameters'
2
+ require_relative 'core_ext/action_dispatch/http/mime_type'
@@ -0,0 +1,9 @@
1
+ require 'action_dispatch/http/mime_type'
2
+
3
+ API_MIME_TYPES = %w(
4
+ application/vnd.api+json
5
+ text/x-json
6
+ application/json
7
+ ).freeze
8
+
9
+ Mime::Type.register API_MIME_TYPES.first, :json, API_MIME_TYPES
@@ -1,3 +1,3 @@
1
1
  module JsonApi::Parameters
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi_parameters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Visuality
@@ -25,6 +25,20 @@ dependencies:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: 4.1.8
28
+ - !ruby/object:Gem::Dependency
29
+ name: actionpack
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 4.1.8
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: 4.1.8
28
42
  - !ruby/object:Gem::Dependency
29
43
  name: json
30
44
  requirement: !ruby/object:Gem::Requirement
@@ -236,6 +250,7 @@ files:
236
250
  - lib/jsonapi_parameters.rb
237
251
  - lib/jsonapi_parameters/core_ext.rb
238
252
  - lib/jsonapi_parameters/core_ext/action_controller/parameters.rb
253
+ - lib/jsonapi_parameters/core_ext/action_dispatch/http/mime_type.rb
239
254
  - lib/jsonapi_parameters/parameters.rb
240
255
  - lib/jsonapi_parameters/translator.rb
241
256
  - lib/jsonapi_parameters/version.rb