mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-10 12:37:48 +00:00
Added support for unevaluatedProperties as Schema and bool #118
Also ran `gofmt` across the entire project. Things need cleaning up. Signed-off-by: Dave Shanley <dave@quobix.com>
This commit is contained in:
@@ -4,32 +4,32 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"strings"
|
||||
"testing"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestServer_MarshalYAML(t *testing.T) {
|
||||
|
||||
server := &Server{
|
||||
URL: "https://pb33f.io",
|
||||
Description: "the b33f",
|
||||
}
|
||||
server := &Server{
|
||||
URL: "https://pb33f.io",
|
||||
Description: "the b33f",
|
||||
}
|
||||
|
||||
desired := `url: https://pb33f.io
|
||||
desired := `url: https://pb33f.io
|
||||
description: the b33f`
|
||||
|
||||
rend, _ := server.Render()
|
||||
assert.Equal(t, desired, strings.TrimSpace(string(rend)))
|
||||
rend, _ := server.Render()
|
||||
assert.Equal(t, desired, strings.TrimSpace(string(rend)))
|
||||
|
||||
// mutate
|
||||
server.Variables = map[string]*ServerVariable{
|
||||
"rainbow": {
|
||||
Enum: []string{"one", "two", "three"},
|
||||
},
|
||||
}
|
||||
// mutate
|
||||
server.Variables = map[string]*ServerVariable{
|
||||
"rainbow": {
|
||||
Enum: []string{"one", "two", "three"},
|
||||
},
|
||||
}
|
||||
|
||||
desired = `url: https://pb33f.io
|
||||
desired = `url: https://pb33f.io
|
||||
description: the b33f
|
||||
variables:
|
||||
rainbow:
|
||||
@@ -38,6 +38,6 @@ variables:
|
||||
- two
|
||||
- three`
|
||||
|
||||
rend, _ = server.Render()
|
||||
assert.Equal(t, desired, strings.TrimSpace(string(rend)))
|
||||
rend, _ = server.Render()
|
||||
assert.Equal(t, desired, strings.TrimSpace(string(rend)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user