Skip to content

Commit

Permalink
Merge pull request #1597 from ruby-grape/fix-docs
Browse files Browse the repository at this point in the history
fix missing type specification in docs, ref #886
  • Loading branch information
dblock authored Mar 21, 2017
2 parents 9dcd94a + 019bcbf commit f4624bf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -754,10 +754,10 @@ You can define validations and coercion options for your parameters using a `par
params do
requires :id, type: Integer
optional :text, type: String, regexp: /\A[a-z]+\z/
group :media do
group :media, type: Hash do
requires :url
end
optional :audio do
optional :audio, type: Hash do
requires :format, type: Symbol, values: [:mp3, :wav, :aac, :ogg], default: :mp3
end
mutually_exclusive :media, :audio
Expand Down Expand Up @@ -1257,24 +1257,24 @@ All of these methods can be used at any nested level.

```ruby
params do
requires :food do
requires :food, type: Hash do
optional :meat
optional :fish
optional :rice
at_least_one_of :meat, :fish, :rice
end
group :drink do
group :drink, type: Hash do
optional :beer
optional :wine
optional :juice
exactly_one_of :beer, :wine, :juice
end
optional :dessert do
optional :dessert, type: Hash do
optional :cake
optional :icecream
mutually_exclusive :cake, :icecream
end
optional :recipe do
optional :recipe, type: Hash do
optional :oil
optional :meat
all_or_none_of :oil, :meat
Expand Down

0 comments on commit f4624bf

Please sign in to comment.