Skip to content

Commit 27f4ab5

Browse files
committed
url validation
1 parent ae59627 commit 27f4ab5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/patch_ruby/models/photo.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,17 @@ def initialize(attributes = {})
6565
# @return Array for valid properties with the reasons
6666
def list_invalid_properties
6767
invalid_properties = Array.new
68+
if @url.nil?
69+
invalid_properties.push('invalid value for "url", url cannot be nil.')
70+
end
71+
6872
invalid_properties
6973
end
7074

7175
# Check to see if the all the properties in the model are valid
7276
# @return true if the model is valid
7377
def valid?
78+
return false if @url.nil?
7479
true
7580
end
7681

0 commit comments

Comments
 (0)