http-client-generator 0.1.18 → 0.1.19
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 796fa455e62adaafc95d3c213d52f5c0647efcbc96597c1cb52b4d4116eb7bf7
|
4
|
+
data.tar.gz: 2a6763039f05c5b6720ab163420f133f432355c5bf5604cd213ffd40cd63435d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7888c6ae59d9721a417c37394daf294382aad6d37f72d7cd2f8322e1322fb12c3d600db4b206625735bce0273e1e92e804a5617973e1c625f3870186a4a98fa3
|
7
|
+
data.tar.gz: c3c5f66284c72cb9bd524fd229c5681d3889c24027591220f74c9bf4a23548510d1ef948156295d9d4040490c8c6c528529219a575cc091b53cb9b5b9793a176
|
@@ -7,6 +7,8 @@ module HttpClientGenerator
|
|
7
7
|
|
8
8
|
module SchemaBuilder
|
9
9
|
def schema_for(name, &block)
|
10
|
+
require 'datacaster'
|
11
|
+
|
10
12
|
@schemas ||= {}
|
11
13
|
@schemas[name] = Datacaster.choosy_schema(&block)
|
12
14
|
|
@@ -24,7 +26,7 @@ module HttpClientGenerator
|
|
24
26
|
def call(req)
|
25
27
|
schema_name = :"#{req.name}_#{req.verb}"
|
26
28
|
|
27
|
-
return req unless @schema_helper.
|
29
|
+
return req unless @schema_helper.respond_to?(schema_name)
|
28
30
|
|
29
31
|
req.response_body = @schema_helper.public_send(schema_name)
|
30
32
|
.value_or { |e| req.raise_message(e) }
|