wsdsl 0.4.2 → 0.4.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.
- data/VERSION +1 -1
- data/lib/json_response_verification.rb +6 -3
- data/wsdsl.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.3
|
@@ -88,18 +88,21 @@ module JSONResponseVerification
|
|
88
88
|
def valid_hash_type?(hash, prop_template)
|
89
89
|
name = prop_template.name.to_s
|
90
90
|
attribute = hash[name]
|
91
|
+
|
91
92
|
# Check for nullity
|
92
|
-
if attribute.nil?
|
93
|
-
return
|
93
|
+
if attribute.nil?
|
94
|
+
return prop_template.opts[:null] == true
|
94
95
|
end
|
96
|
+
|
95
97
|
type = prop_template.type
|
96
98
|
return true if type.nil?
|
99
|
+
|
97
100
|
rule = ParamsVerification.type_validations[type.to_sym]
|
98
101
|
if rule.nil?
|
99
102
|
puts "Don't know how to validate attributes of type #{type}" if type.to_sym != :string
|
100
103
|
return true
|
101
104
|
end
|
102
|
-
|
105
|
+
|
103
106
|
attribute.to_s =~ rule
|
104
107
|
end
|
105
108
|
|
data/wsdsl.gemspec
CHANGED