I'm using the RSwag gem to create swagger OpenAPI specs: https://github.com/rswag/rswag
And I'm trying to get the schema for the response to appear in the Swagger API docs that are generated with the following spec:
path '/api/v2/ping' do
get('returns a response when pinged') do
tags 'Ping'
consumes 'application/json'
security [bearerAuth: []]
parameter name: :Authorization, in: :header, type: :string
description 'Ping the API'
response(200, 'successful') do
header 'X-Rate-Limit-Limit',
schema: { type: :integer },
description: 'The number of allowed requests in the current period'
header 'X-Rate-Limit-Remaining',
schema: { type: :integer },
description: 'The number of remaining requests in the current period'
schema type: :object,
properties: {
ok: { type: :boolean }
}
example 'application/json', :example, {
ok: true
}, 'Ping', 'A successful ping!'
run_test!
end
...
However the model doesn't appear next to the example:
When adding the schema to a response (not the request) it should be showing the model for the response object... e.g.
How do I add the schema to the response?