Skip to content

Commit 928d934

Browse files
committed
Add usage of array of primitive types to documentation
1 parent d9df7c7 commit 928d934

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,30 @@ end
481481
}
482482
```
483483
484+
#### Array type
485+
486+
If you want to pass an array of primitive types, you can do this with the following:
487+
488+
```ruby
489+
params do
490+
requires :action_ids, type: Array[Integer]
491+
end
492+
post :act do
493+
...
494+
end
495+
```
496+
497+
```json
498+
{
499+
"in": "formData",
500+
"name": "action_ids",
501+
"type": "array",
502+
"items": {
503+
"type": "integer"
504+
},
505+
"required": true
506+
}
507+
```
484508
485509
#### Multi types
486510

0 commit comments

Comments
 (0)