Slide 9
Slide 9 text
Typical RSwag test
典型的な
RSwagテスト
schema type: :object,
properties: {
id: { type: :integer },
full_name: { type: :string },
bar: { type: :object, properties: { … }}
},
required: [ 'id', 'full_name' ]
# spec/requests/api/v1/foos_spec.rb
RSpec.describe "/api/v1/foos", openapi_spec: "v1/schema.yml" do
path "/v1/foos/{id}" do
get "Get a Foo" do
parameter name: :page, in: :query, schema: { type: :integer, default: 1 }, require
response "200", "A successful response" do
run_test!
end
end