Skip to content

Commit

Permalink
Mark path params as required
Browse files Browse the repository at this point in the history
  • Loading branch information
k0kubun committed Jun 19, 2020
1 parent 86c8bec commit 592e1ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/rspec/openapi/schema_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def build_parameters(record)
parameters << {
name: key.to_s,
in: 'path',
required: true,
schema: build_property(try_cast(value)),
}
end
Expand Down
3 changes: 3 additions & 0 deletions spec/railsapp/doc/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ paths:
parameters:
- name: id
in: path
required: true
schema:
type: integer
responses:
Expand Down Expand Up @@ -155,6 +156,7 @@ paths:
parameters:
- name: id
in: path
required: true
schema:
type: integer
responses:
Expand Down Expand Up @@ -187,6 +189,7 @@ paths:
parameters:
- name: id
in: path
required: true
schema:
type: integer
responses:
Expand Down

0 comments on commit 592e1ae

Please sign in to comment.