request_handler 0.15.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/lib/request_handler/json_api_document_parser.rb +0 -1
- data/lib/request_handler/schema_parser.rb +14 -0
- data/lib/request_handler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65eef6ec09f3ee1701b3d47ac807e34ae25bcf1da1390f4115264edfe0596826
|
4
|
+
data.tar.gz: b3be4acbdf53d5a1625c75858e0aee50a2e9b99bc5b4f1208cd79d891473c7fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc8b73661dcdd394026e6ee34bd270adef9b7130a29c5a86a62962ada7bb36c618625411ad2ecd006d34a5933e1416831ad54672b51c0ede3ffe15bf61941466
|
7
|
+
data.tar.gz: 0c8b9cb186c4c4fe90ba58baf401d9b4c739785001214bc14cea683ba1618f9b6fbfb14ff9933908918f1cea1a35d3803e65e76827ddb6de7ab82267e290411a
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [1.0.0] - 2018-07-03
|
10
|
+
### Added
|
11
|
+
- possibility to send NULL values in relationships
|
12
|
+
|
13
|
+
### Fixed
|
14
|
+
- fix nested schemas with symbolized keys
|
15
|
+
|
9
16
|
## [0.15.0] - 2018-06-20
|
10
17
|
### Added
|
11
18
|
- JsonParser for non-jsonapi documents in body an multipart files
|
@@ -91,7 +98,8 @@ sort_params returns an array of dtos now `DataTransferObject.new(field: "test",
|
|
91
98
|
|
92
99
|
version bump for publishing
|
93
100
|
|
94
|
-
[Unreleased]: https://github.com/runtastic/request_handler/compare/
|
101
|
+
[Unreleased]: https://github.com/runtastic/request_handler/compare/v1.0.0...HEAD
|
102
|
+
[1.0.0]: https://github.com/runtastic/request_handler/compare/v0.15.0...v1.0.0
|
95
103
|
[0.15.0]: https://github.com/runtastic/request_handler/compare/v0.14.0...v0.15.0
|
96
104
|
[0.14.0]: https://github.com/runtastic/request_handler/compare/v0.13.0...v0.14.0
|
97
105
|
[0.13.0]: https://github.com/runtastic/request_handler/compare/v0.12.0...v0.13.0
|
@@ -17,6 +17,7 @@ module RequestHandler
|
|
17
17
|
|
18
18
|
def validate_schema(data, with: schema)
|
19
19
|
raise MissingArgumentError, data: 'is missing' if data.nil?
|
20
|
+
data = deep_symbolize_keys(data) if with.rules.keys.first.is_a?(Symbol)
|
20
21
|
validator = validate(data, schema: with)
|
21
22
|
validation_failure?(validator)
|
22
23
|
validator.output
|
@@ -47,6 +48,19 @@ module RequestHandler
|
|
47
48
|
memo
|
48
49
|
end
|
49
50
|
|
51
|
+
def deep_symbolize_keys(hash)
|
52
|
+
mem = {}
|
53
|
+
hash.map do |key, value|
|
54
|
+
if value.is_a?(Hash)
|
55
|
+
value = deep_symbolize_keys(value)
|
56
|
+
elsif value.is_a?(Array)
|
57
|
+
value.map! { |v| v.is_a?(Hash) ? deep_symbolize_keys(v) : v }
|
58
|
+
end
|
59
|
+
mem[key.to_sym] = value
|
60
|
+
end
|
61
|
+
mem
|
62
|
+
end
|
63
|
+
|
50
64
|
attr_reader :schema, :schema_options
|
51
65
|
end
|
52
66
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: request_handler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Eger
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-07-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dry-validation
|