Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NOT READY] Check Array nested in Array and Hash #482

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions spec/swagger_v2/api_swagger_v2_param_type_body_nested_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class NestedBodyParamTypeApi < Grape::API
requires :street, type: String, documentation: { desc: 'street', in: 'body' }
requires :postcode, type: String, documentation: { desc: 'postcode', in: 'body' }
requires :city, type: String, documentation: { desc: 'city', in: 'body' }
optional :country, type: String, documentation: { desc: 'country', in: 'body' }
optional :country, type: Array[String], documentation: { desc: 'country', in: 'body' }
end
end
end
Expand All @@ -36,7 +36,7 @@ class NestedBodyParamTypeApi < Grape::API
optional :street, type: String, documentation: { desc: 'street', in: 'body' }
optional :postcode, type: String, documentation: { desc: 'postcode', in: 'formData' }
optional :city, type: String, documentation: { desc: 'city', in: 'body' }
optional :country, type: String, documentation: { desc: 'country', in: 'body' }
optional :country, type: Array[String], documentation: { desc: 'country', in: 'body' }
end
end

Expand All @@ -55,13 +55,13 @@ class NestedBodyParamTypeApi < Grape::API
optional :street, type: String, documentation: { desc: 'street', in: 'body' }
requires :postcode, type: Integer, documentation: { desc: 'postcode', in: 'formData' }
optional :city, type: String, documentation: { desc: 'city', in: 'body' }
optional :country, type: String, documentation: { desc: 'country', in: 'body' }
optional :country, type: Array[String], documentation: { desc: 'country', in: 'body' }
end
optional :delivery_address, type: Hash do
optional :street, type: String, documentation: { desc: 'street', in: 'body' }
optional :postcode, type: String, documentation: { desc: 'postcode', in: 'formData' }
optional :city, type: String, documentation: { desc: 'city', in: 'body' }
optional :country, type: String, documentation: { desc: 'country', in: 'body' }
optional :country, type: Array[String], documentation: { desc: 'country', in: 'body' }
end
end
end
Expand All @@ -79,13 +79,13 @@ class NestedBodyParamTypeApi < Grape::API
optional :street, type: String, documentation: { desc: 'street', in: 'body' }
requires :postcode, type: String, documentation: { desc: 'postcode', in: 'formData' }
optional :city, type: String, documentation: { desc: 'city', in: 'body' }
optional :country, type: String, documentation: { desc: 'country', in: 'body' }
optional :country, type: Array[String], documentation: { desc: 'country', in: 'body' }
end
optional :delivery_address, type: Hash do
optional :street, type: String, documentation: { desc: 'street', in: 'body' }
optional :postcode, type: String, documentation: { desc: 'postcode', in: 'formData' }
optional :city, type: String, documentation: { desc: 'city', in: 'body' }
optional :country, type: String, documentation: { desc: 'country', in: 'body' }
optional :country, type: Array[String], documentation: { desc: 'country', in: 'body' }
end
end

Expand Down Expand Up @@ -134,7 +134,7 @@ def app
'street' => { 'type' => 'string', 'description' => 'street' },
'postcode' => { 'type' => 'string', 'description' => 'postcode' },
'city' => { 'type' => 'string', 'description' => 'city' },
'country' => { 'type' => 'string', 'description' => 'country' }
'country' => { 'type' => 'array', 'items' => { 'type' => 'string' }, 'description' => 'country' }
},
'required' => %w(street postcode city)
}
Expand Down Expand Up @@ -169,7 +169,7 @@ def app
'street' => { 'type' => 'string', 'description' => 'street' },
'postcode' => { 'type' => 'string', 'description' => 'postcode' },
'city' => { 'type' => 'string', 'description' => 'city' },
'country' => { 'type' => 'string', 'description' => 'country' }
'country' => { 'type' => 'array', 'items' => { 'type' => 'string' }, 'description' => 'country' }
}
}
},
Expand Down Expand Up @@ -215,7 +215,7 @@ def app
'street' => { 'type' => 'string', 'description' => 'street' },
'postcode' => { 'type' => 'integer', 'format' => 'int32', 'description' => 'postcode' },
'city' => { 'type' => 'string', 'description' => 'city' },
'country' => { 'type' => 'string', 'description' => 'country' }
'country' => { 'type' => 'array', 'items' => { 'type' => 'string' }, 'description' => 'country' }
},
'required' => ['postcode']
}
Expand All @@ -226,7 +226,7 @@ def app
'street' => { 'type' => 'string', 'description' => 'street' },
'postcode' => { 'type' => 'string', 'description' => 'postcode' },
'city' => { 'type' => 'string', 'description' => 'city' },
'country' => { 'type' => 'string', 'description' => 'country' }
'country' => { 'type' => 'array', 'items' => { 'type' => 'string' }, 'description' => 'country' }
}
}
},
Expand Down Expand Up @@ -259,7 +259,7 @@ def app
'street' => { 'type' => 'string', 'description' => 'street' },
'postcode' => { 'type' => 'string', 'description' => 'postcode' },
'city' => { 'type' => 'string', 'description' => 'city' },
'country' => { 'type' => 'string', 'description' => 'country' }
'country' => { 'type' => 'array', 'items' => { 'type' => 'string' }, 'description' => 'country' }
},
'required' => ['postcode']
},
Expand All @@ -269,7 +269,7 @@ def app
'street' => { 'type' => 'string', 'description' => 'street' },
'postcode' => { 'type' => 'string', 'description' => 'postcode' },
'city' => { 'type' => 'string', 'description' => 'city' },
'country' => { 'type' => 'string', 'description' => 'country' }
'country' => { 'type' => 'array', 'items' => { 'type' => 'string' }, 'description' => 'country' }
}
}
},
Expand Down