fix mistake in assigning header nodes for type

This commit is contained in:
Greg Myers
2020-03-22 23:45:47 +00:00
parent eb58fe687a
commit e9aebe6221
3 changed files with 20 additions and 38 deletions

View File

@@ -78,11 +78,7 @@ module Rswag
let(:document) { nil }
it 'converts query and path params, type: to schema: { type: }' do
expect(swagger_doc).to match(
openapi: '3.0.1',
servers: {
urls: ['http://api.example.com/foo', 'https://api.example.com/foo']
},
expect(swagger_doc.slice(:paths)).to match(
paths: {
'/blogs' => {
parameters: [{ schema: { type: :string } }],
@@ -100,6 +96,14 @@ module Rswag
}
)
end
it 'converts basePath, schemas and host to urls' do
expect(swagger_doc.slice(:servers)).to match(
servers: {
urls: ['http://api.example.com/foo', 'https://api.example.com/foo']
}
)
end
end
end