graphiti 2.2.2 → 2.2.3

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: 185e66f29378e7e50a478f273bd0c3d2b7cf8116aa3d61668d05d34761ab8d27
4
- data.tar.gz: 1a7286d5912d8133adb83a2c8bb330cd6876d088a88aab8abc01cee08dfbb251
3
+ metadata.gz: 98cb7e1f53afb0295a3aad4688e381c36cacd4f71f9b761e9812667c06d71d0c
4
+ data.tar.gz: e7031c43824fde295f4628dbb89f8be46336fd9a5598483328a0a9148e792ea9
5
5
  SHA512:
6
- metadata.gz: 43fc294150c26b1b09ca78290dc864171538f5d988b736d5cbd5db4c77b9979d0a3077ef738452a783b4d9a7668331e7f32a67a1fe657c6a858bc0a77e7c3ae4
7
- data.tar.gz: 0a7b8ca5bc7ffba5365a1b74c2bc195b6ec56349344eb0ca44445580b0ef9db30654fc030ab135684024d872488d6652bd214d6a67619182f76fb5d4b5038732
6
+ metadata.gz: ce4fc7fe0fa11226333579c7cba7fa68dd948f0ca2f4b3f6fed9a9754e9739d1628610016a0b4f34b24614fd57a8a5aa2b3ed5289a54fbca91cc447dd1999fed
7
+ data.tar.gz: 05e5e094a533190054192ae7a07121264e6ae8b233e64507c515e3a94dbfbf6b8848afaf1150a3a990d73de3aa3f49f9466522f8a8448deac06271456c99da98
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  graphiti changelog
2
2
 
3
+ ## [2.2.3](https://github.com/graphiti-api/graphiti/compare/v2.2.2...v2.2.3) (2026-10-30)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * validate the relationships of a document wrapped in _jsonapi ([5e2880e](https://github.com/graphiti-api/graphiti/commit/5e2880ed23624657ec9280954d768285d461b63c))
9
+
3
10
  ## [2.2.2](https://github.com/graphiti-api/graphiti/compare/v2.2.1...v2.2.2) (2026-10-22)
4
11
 
5
12
 
@@ -16,11 +16,11 @@ module Graphiti
16
16
  # Right now, all requests - even reads - go through the validator
17
17
  # In the future these should have their own validation logic, but
18
18
  # for now we can just bypass
19
- return errors.blank? unless @params.has_key?(:data)
19
+ return errors.blank? unless document.has_key?(:data)
20
20
  return false unless validate_data_shape
21
21
 
22
22
  resource = @root_resource
23
- if @params[:data].has_key?(:type)
23
+ if document[:data].has_key?(:type)
24
24
  if (meta_type = deserialized_payload.meta[:type].try(:to_sym))
25
25
  if @root_resource.type != meta_type && @root_resource.polymorphic?
26
26
  resource = @root_resource.class.resource_for_type(meta_type).new
@@ -50,6 +50,10 @@ module Graphiti
50
50
 
51
51
  private
52
52
 
53
+ def document
54
+ deserialized_payload.params
55
+ end
56
+
53
57
  def validate_page
54
58
  page = @params[:page]
55
59
  return if page.nil? || page.respond_to?(:each_pair)
@@ -58,7 +62,7 @@ module Graphiti
58
62
  end
59
63
 
60
64
  def validate_data_shape
61
- data = @params[:data]
65
+ data = document[:data]
62
66
  return true if data.nil? || data.respond_to?(:each_pair)
63
67
 
64
68
  @errors.add(:data, :invalid)
@@ -1,3 +1,3 @@
1
1
  module Graphiti
2
- VERSION = "2.2.2"
2
+ VERSION = "2.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiti
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond