Permalink
Browse files

Merge pull request #39 from seomoz/fix-regression

Fix regression.
  • Loading branch information...
2 parents eed1e36 + fe0af82 commit bfbea26edebbe20f0f8649c8ef63329f3e9baf22 @myronmarston myronmarston committed Dec 5, 2013
Showing with 6 additions and 1 deletion.
  1. +1 −1 lib/interpol/endpoint.rb
  2. +5 −0 spec/unit/interpol/endpoint_spec.rb
@@ -282,7 +282,7 @@ def conditionally_make_nullable(raw_schema)
# Mark as non-nullable so it doesn't try to recurse down into it
# and make it nullable at that level (since we are taking care of it at this level)
sub_schema = raw_schema.merge('nullable' => false)
- raw_schema.replace('type' => ['null', sub_schema])
+ raw_schema.replace('type' => ['null', sub_schema], 'optional' => sub_schema['optional'])
end
def should_be_nullable?(raw_schema)
@@ -397,6 +397,11 @@ def new_with(hash)
subject.validate_data!({})
end
+ it 'does not require optional nullable properties' do
+ schema['properties']['foo'].merge!('optional' => true, 'nullable' => true)
+ subject.validate_data!({})
+ end
+
it 'does not allow additional properties' do
expect {
subject.validate_data!('bar' => 3)

0 comments on commit bfbea26

Please sign in to comment.