introspective_grape 0.5.6 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/introspective_grape/validators.rb +5 -3
- data/lib/introspective_grape/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: d29e073d96e9a6f2569eeaec65ece289f344fd5f0b6ea88a0dfb345d36d51052
|
4
|
+
data.tar.gz: dac77dd6bc6812de00ec06ee5299c5cea5ff0f3539a304e6a1d1335f72e69f36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 118befdc8fca693dd91610d8c0ecff86ca2e297cdb1b3817384b1fa78958a5949f1d252cc70eadf2187bee87080fb9949382e656b6765f259f4d23bba7fd2c47
|
7
|
+
data.tar.gz: 21f3339a6e874bca7d94fa3efcd92812afbbc0e9b74371cafc8eb3e1644334930671ee59841a13237998272acc06954916a5b09ccd9eb760df38c8b3a28557f9
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
require 'grape/validations'
|
2
2
|
module Grape
|
3
3
|
module Validators
|
4
|
-
|
4
|
+
# Validations::Base becomes Validators::Base somewhere between 1.6.0 and 1.6.2
|
5
|
+
validation_class = defined?(Grape::Validations::Base) ? Grape::Validations::Base : Grape::Validations::Validators::Base
|
6
|
+
class Json < validation_class
|
5
7
|
def validate_param!(field, params)
|
6
8
|
begin
|
7
9
|
JSON.parse( params[field] )
|
@@ -11,7 +13,7 @@ module Grape
|
|
11
13
|
end
|
12
14
|
end
|
13
15
|
|
14
|
-
class JsonArray <
|
16
|
+
class JsonArray < validation_class
|
15
17
|
def validate_param!(field, params)
|
16
18
|
begin
|
17
19
|
raise unless JSON.parse( params[field] ).is_a? Array
|
@@ -21,7 +23,7 @@ module Grape
|
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
24
|
-
class JsonHash <
|
26
|
+
class JsonHash < validation_class
|
25
27
|
def validate_param!(field, params)
|
26
28
|
begin
|
27
29
|
raise unless JSON.parse( params[field] ).is_a? Hash
|