spec/support/the_paths_definitions.rb in grape-swagger-1.4.0 vs spec/support/the_paths_definitions.rb in grape-swagger-1.4.1
- old
+ new
@@ -6,11 +6,11 @@
'/in_body' => {
post: {
produces: ['application/json'],
consumes: ['application/json'],
parameters: [
- { in: 'body', name: 'in_body_1', description: 'in_body_1', type: 'integer', format: 'int32', required: true },
+ { in: 'body', name: 'in_body_1', description: 'in_body_1', type: 'integer', format: 'int32', required: true, example: 23 },
{ in: 'body', name: 'in_body_2', description: 'in_body_2', type: 'string', required: false },
{ in: 'body', name: 'in_body_3', description: 'in_body_3', type: 'string', required: false }
],
responses: { 201 => { description: 'post in body /wo entity', schema: { '$ref' => '#/definitions/InBody' } } },
tags: ['in_body'],
@@ -29,11 +29,11 @@
consumes: ['application/json'],
parameters: [
{ in: 'path', name: 'key', description: nil, type: 'integer', format: 'int32', required: true },
{ in: 'body', name: 'in_body_1', description: 'in_body_1', type: 'integer', format: 'int32', required: true },
{ in: 'body', name: 'in_body_2', description: 'in_body_2', type: 'string', required: false },
- { in: 'body', name: 'in_body_3', description: 'in_body_3', type: 'string', required: false }
+ { in: 'body', name: 'in_body_3', description: 'in_body_3', type: 'string', required: false, example: 'my example string' }
],
responses: { 200 => { description: 'put in body /wo entity', schema: { '$ref' => '#/definitions/InBody' } } },
tags: ['in_body'],
operationId: 'putInBodyKey'
},
@@ -83,11 +83,11 @@
let(:expected_post_defs) do
{
type: 'object',
properties: {
- in_body_1: { type: 'integer', format: 'int32', description: 'in_body_1' },
+ in_body_1: { type: 'integer', format: 'int32', description: 'in_body_1', example: 23 },
in_body_2: { type: 'string', description: 'in_body_2' },
in_body_3: { type: 'string', description: 'in_body_3' }
},
required: [:in_body_1]
}
@@ -97,10 +97,10 @@
{
type: 'object',
properties: {
in_body_1: { type: 'integer', format: 'int32', description: 'in_body_1' },
in_body_2: { type: 'string', description: 'in_body_2' },
- in_body_3: { type: 'string', description: 'in_body_3' }
+ in_body_3: { type: 'string', description: 'in_body_3', example: 'my example string' }
},
required: [:in_body_1]
}
end