-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
When you have an object and you force required: false on at least one attribute, but none are required : true, it will still creates a "required" property with an empty array
schema = object do
string :my_key, required: false
string :my_other_key, required: true
end.as_json
# => {"type"=>"object", "required"=>["my_other_key"], "properties"=>{"my_key"=> {"type"=>"string"}, "my_other_key"=>{"type"=>"string"}}}
schema = object do
string :my_key
string :my_other_key
end.as_json
# => {"type"=>"object", "properties"=>{"my_key"=>{"type"=>"string"}, "my_other_key"=>{"type"=>"string"}}}
schema = object do
string :my_key
string :my_other_key, required: false
end.as_json
# => {"type"=>"object", "required"=>[], "properties"=>{"my_key"=>{"type"=>"string"}, "my_other_key"=>{"type"=>"string"}}}Metadata
Metadata
Assignees
Labels
No labels