mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-10 04:20:24 +00:00
Fixed document test
No release required, no changes
This commit is contained in:
@@ -361,11 +361,9 @@ info:
|
|||||||
// url: https://pb33f.io/license
|
// url: https://pb33f.io/license
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDocument_Panic(t *testing.T) {
|
func TestDocument_Paths_As_Array(t *testing.T) {
|
||||||
|
|
||||||
// How to mutate values in an OpenAPI Specification, without re-ordering original content.
|
// paths can now be wrapped in an array.
|
||||||
|
|
||||||
// create very small, and useless spec that does nothing useful, except showcase this feature.
|
|
||||||
spec := `{
|
spec := `{
|
||||||
"openapi": "3.1.0",
|
"openapi": "3.1.0",
|
||||||
"paths": [
|
"paths": [
|
||||||
@@ -382,8 +380,6 @@ func TestDocument_Panic(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Sprintf("cannot create new document: %e", err))
|
panic(fmt.Sprintf("cannot create new document: %e", err))
|
||||||
}
|
}
|
||||||
|
v3Model, _ := doc.BuildV3Model()
|
||||||
// because we know this is a v3 spec, we can build a ready to go model from it.
|
assert.NotNil(t, v3Model)
|
||||||
v3Model, errors := doc.BuildV3Model()
|
|
||||||
fmt.Print(v3Model, errors)
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user