mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-23 06:16:42 +00:00
Fixes response validators specs for v3 structure
This commit is contained in:
parent
659b328eda
commit
aa59c5ff91
@ -11,7 +11,7 @@ module Rswag
|
||||
allow(config).to receive(:get_swagger_doc).and_return(swagger_doc)
|
||||
end
|
||||
let(:config) { double('config') }
|
||||
let(:swagger_doc) { {} }
|
||||
let(:swagger_doc) { {:components => {}} }
|
||||
let(:example) { double('example') }
|
||||
let(:metadata) do
|
||||
{
|
||||
@ -58,14 +58,21 @@ module Rswag
|
||||
|
||||
context 'referenced schemas' do
|
||||
before do
|
||||
swagger_doc[:definitions] = {
|
||||
# swagger_doc[:definitions] = {
|
||||
# 'blog' => {
|
||||
# type: :object,
|
||||
# properties: { foo: { type: :string } },
|
||||
# required: ['foo']
|
||||
# }
|
||||
# }
|
||||
swagger_doc[:components][:schemas] = {
|
||||
'blog' => {
|
||||
type: :object,
|
||||
properties: { foo: { type: :string } },
|
||||
required: ['foo']
|
||||
}
|
||||
}
|
||||
metadata[:response][:schema] = { '$ref' => '#/definitions/blog' }
|
||||
metadata[:response][:schema] = { '$ref' => '#/components/schemas/blog' }
|
||||
end
|
||||
|
||||
it 'uses the referenced schema to validate the response body' do
|
||||
|
||||
Loading…
Reference in New Issue
Block a user