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,30 +4,30 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/pb33f/libopenapi/datamodel/high/base"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"strings"
|
||||
"testing"
|
||||
"github.com/pb33f/libopenapi/datamodel/high/base"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestHeader_MarshalYAML(t *testing.T) {
|
||||
|
||||
header := &Header{
|
||||
Description: "A header",
|
||||
Required: true,
|
||||
Deprecated: true,
|
||||
AllowEmptyValue: true,
|
||||
Style: "simple",
|
||||
Explode: true,
|
||||
AllowReserved: true,
|
||||
Example: "example",
|
||||
Examples: map[string]*base.Example{"example": {Value: "example"}},
|
||||
Extensions: map[string]interface{}{"x-burgers": "why not?"},
|
||||
}
|
||||
header := &Header{
|
||||
Description: "A header",
|
||||
Required: true,
|
||||
Deprecated: true,
|
||||
AllowEmptyValue: true,
|
||||
Style: "simple",
|
||||
Explode: true,
|
||||
AllowReserved: true,
|
||||
Example: "example",
|
||||
Examples: map[string]*base.Example{"example": {Value: "example"}},
|
||||
Extensions: map[string]interface{}{"x-burgers": "why not?"},
|
||||
}
|
||||
|
||||
rend, _ := header.Render()
|
||||
rend, _ := header.Render()
|
||||
|
||||
desired := `description: A header
|
||||
desired := `description: A header
|
||||
required: true
|
||||
deprecated: true
|
||||
allowEmptyValue: true
|
||||
@@ -40,6 +40,6 @@ examples:
|
||||
value: example
|
||||
x-burgers: why not?`
|
||||
|
||||
assert.Equal(t, desired, strings.TrimSpace(string(rend)))
|
||||
assert.Equal(t, desired, strings.TrimSpace(string(rend)))
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user