Skip to content

Commit

Permalink
test that boolean schemas are schemas for openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
notEthan committed Jan 31, 2022
1 parent 0295b35 commit 398ce1e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/scorpio_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,28 @@ def test_that_it_has_a_version_number
assert_equal(0, hash[Article.read(id: blog_article.id)])
end
end

describe 'openapi boolean schema' do
it 'is a schema, v3' do
document = Scorpio::OpenAPI::V3::Document.new_jsi({
'components' => {
'schemas' => {
'a' => {
'additionalProperties' => true
}
}
}
})
assert_kind_of(JSI::Schema, document.components.schemas['a'].additionalProperties)
end
it 'is a schema, v2' do
document = Scorpio::OpenAPI::V2::Document.new_jsi({
'definitions' => {
'a' => {
'additionalProperties' => true
}
}
})
assert_kind_of(JSI::Schema, document.definitions['a'].additionalProperties)
end
end

0 comments on commit 398ce1e

Please sign in to comment.