Another round of coverage

will it go green? will it stay red? who knows…

Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
quobix
2023-11-01 11:50:23 -04:00
parent 3c27c43ec0
commit 33fc552c65
5 changed files with 35 additions and 4 deletions

View File

@@ -825,6 +825,16 @@ func TestCreateDocument_YamlAnchor(t *testing.T) {
assert.NotNil(t, postJsonType)
}
func TestCreateDocument_NotOpenAPI_EnforcedDocCheck(t *testing.T) {
yml := `notadoc: no`
info, _ := datamodel.ExtractSpecInfo([]byte(yml))
var err error
_, err = CreateDocumentFromConfig(info, &datamodel.DocumentConfiguration{})
assert.Equal(t,
"no openapi version/tag found, cannot create document", err.Error())
}
func ExampleCreateDocument() {
// How to create a low-level OpenAPI 3 Document