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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/graphiti/request_validators/validator.rb +7 -3
- data/lib/graphiti/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 98cb7e1f53afb0295a3aad4688e381c36cacd4f71f9b761e9812667c06d71d0c
|
|
4
|
+
data.tar.gz: e7031c43824fde295f4628dbb89f8be46336fd9a5598483328a0a9148e792ea9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
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
|
|
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 =
|
|
65
|
+
data = document[:data]
|
|
62
66
|
return true if data.nil? || data.respond_to?(:each_pair)
|
|
63
67
|
|
|
64
68
|
@errors.add(:data, :invalid)
|
data/lib/graphiti/version.rb
CHANGED