jsonapi-realizer 6.1.1 → 6.1.3

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: c68ffbcd4a507dfa58fe1951023e0d1ef4d362b841138542b25a051a8add752c
4
- data.tar.gz: f56185a4a2948a3e1ba1364faaf02803ba299c6b1652208ce127fa042a88f5ed
3
+ metadata.gz: 14861545f76adf51438c3ed901e109eea2bf619523ca09a14e1696ff95ec50c1
4
+ data.tar.gz: 667bd76c3a17968a74346bde0e4ecacb7dc0c4f75e199d51b78e5406e5688a4c
5
5
  SHA512:
6
- metadata.gz: e5e346fceeab12188a36fd6c142b54fa8ff41cfa5dc49a55f201f92f454f00b4d2abf9ff32f51d347927f40079572442ed323de6ae4b35ac7c5ca213a38e4ca8
7
- data.tar.gz: 9a73e8e119c82793a6f7d1508cb27490cabfa1daffa0b91e2269cd8202c2add58aa1faa6332371eaa39abb643c74e9ce20ab3c0d07f4a06270edcb3a3263c01a
6
+ metadata.gz: aa15bebefd38c647386d967471202e3ec1ed296f51798058828c93b576c709eb39e74316e9d11e6793522c3d56850483f008aff7e9bdf6b7199a419dc91ca2a9
7
+ data.tar.gz: 7a35e4b35d27a8a899283414dc2b07bd19caeb53325353fea2e5285d58c699cf4099508f93a30e150ef9f457b828b767bdad1be51872faf8b692b80e7754007c
@@ -8,9 +8,13 @@ module JSONAPI
8
8
  attr_accessor(:default_origin)
9
9
  attr_accessor(:default_identifier)
10
10
  attr_accessor(:adapter_mappings)
11
+ attr_accessor(:default_missing_accept_type_exception)
12
+ attr_accessor(:default_invalid_accept_type_exception)
11
13
  attr_accessor(:default_missing_content_type_exception)
12
14
  attr_accessor(:default_invalid_content_type_exception)
13
15
 
16
+ validates_presence_of(:default_missing_accept_type_exception)
17
+ validates_presence_of(:default_invalid_accept_type_exception)
14
18
  validates_presence_of(:default_missing_content_type_exception)
15
19
  validates_presence_of(:default_invalid_content_type_exception)
16
20
 
@@ -3,11 +3,12 @@
3
3
  module JSONAPI
4
4
  module Realizer
5
5
  class Error
6
- class InvalidDataTypeProperty < Error
6
+ class InvalidAcceptTypeHeader < Error
7
7
  attr_accessor(:given)
8
+ attr_accessor(:wanted)
8
9
 
9
10
  def message
10
- "root.data property was #{given}, which is not an Hash, Array, or nil"
11
+ "HTTP Accept Header recieved is #{given}, but expected #{wanted}"
11
12
  end
12
13
  end
13
14
  end
@@ -3,7 +3,7 @@
3
3
  module JSONAPI
4
4
  module Realizer
5
5
  class Error
6
- class MissingRootProperty < Error
6
+ class MissingAcceptTypeHeader < Error
7
7
  end
8
8
  end
9
9
  end
@@ -5,12 +5,10 @@ module JSONAPI
5
5
  class Error < StandardError
6
6
  include(ActiveModel::Model)
7
7
 
8
+ require_relative("error/invalid_accept_type_header")
9
+ require_relative("error/missing_accept_type_header")
8
10
  require_relative("error/invalid_content_type_header")
9
11
  require_relative("error/missing_content_type_header")
10
- require_relative("error/invalid_root_property")
11
- require_relative("error/missing_root_property")
12
- require_relative("error/missing_data_type_property")
13
- require_relative("error/include_without_data_property")
14
12
  require_relative("error/resource_attribute_not_found")
15
13
  require_relative("error/resource_relationship_not_found")
16
14
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module JSONAPI
4
4
  module Realizer
5
- VERSION = "6.1.1"
5
+ VERSION = "6.1.3"
6
6
  end
7
7
  end
@@ -18,6 +18,8 @@ module JSONAPI
18
18
  require_relative("realizer/controller")
19
19
 
20
20
  @configuration ||= Configuration.new(
21
+ default_invalid_accept_type_exception: JSONAPI::Realizer::Error::InvalidAcceptTypeHeader,
22
+ default_missing_accept_type_exception: JSONAPI::Realizer::Error::MissingAcceptTypeHeader,
21
23
  default_invalid_content_type_exception: JSONAPI::Realizer::Error::InvalidContentTypeHeader,
22
24
  default_missing_content_type_exception: JSONAPI::Realizer::Error::MissingContentTypeHeader,
23
25
  default_identifier: :id,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi-realizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.1
4
+ version: 6.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kurtis Rainbolt-Greene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-19 00:00:00.000000000 Z
11
+ date: 2023-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -72,13 +72,10 @@ files:
72
72
  - lib/jsonapi/realizer/context.rb
73
73
  - lib/jsonapi/realizer/controller.rb
74
74
  - lib/jsonapi/realizer/error.rb
75
- - lib/jsonapi/realizer/error/include_without_data_property.rb
75
+ - lib/jsonapi/realizer/error/invalid_accept_type_header.rb
76
76
  - lib/jsonapi/realizer/error/invalid_content_type_header.rb
77
- - lib/jsonapi/realizer/error/invalid_data_type_property.rb
78
- - lib/jsonapi/realizer/error/invalid_root_property.rb
77
+ - lib/jsonapi/realizer/error/missing_accept_type_header.rb
79
78
  - lib/jsonapi/realizer/error/missing_content_type_header.rb
80
- - lib/jsonapi/realizer/error/missing_data_type_property.rb
81
- - lib/jsonapi/realizer/error/missing_root_property.rb
82
79
  - lib/jsonapi/realizer/error/resource_attribute_not_found.rb
83
80
  - lib/jsonapi/realizer/error/resource_relationship_not_found.rb
84
81
  - lib/jsonapi/realizer/resource.rb
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module JSONAPI
4
- module Realizer
5
- class Error
6
- class IncludeWithoutDataProperty < Error
7
- end
8
- end
9
- end
10
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module JSONAPI
4
- module Realizer
5
- class Error
6
- class InvalidRootProperty < Error
7
- attr_accessor(:given)
8
-
9
- def message
10
- "root property was #{given}, which is not an Hash"
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module JSONAPI
4
- module Realizer
5
- class Error
6
- class MissingDataTypeProperty < Error
7
- end
8
- end
9
- end
10
- end