mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 12:37:49 +00:00
Added support for original format rendering #105
Original input document types are now rendered automatically as JSON or YAML (vs always being YAML). This only operates at the `Document` level for rendering out entire documents. Requested in #105 Signed-off-by: Dave Shanley <dave@quobix.com>
This commit is contained in:
@@ -637,6 +637,14 @@ func TestConvertYAMLtoJSON(t *testing.T) {
|
||||
assert.Nil(t, str)
|
||||
}
|
||||
|
||||
func TestConvertYAMLtoJSONPretty(t *testing.T) {
|
||||
str, err := ConvertYAMLtoJSONPretty([]byte("hello: there"), "", " ")
|
||||
assert.NoError(t, err)
|
||||
assert.NotNil(t, str)
|
||||
assert.Equal(t, "{\n \"hello\": \"there\"\n}", string(str))
|
||||
|
||||
}
|
||||
|
||||
func TestIsHttpVerb(t *testing.T) {
|
||||
assert.True(t, IsHttpVerb("get"))
|
||||
assert.True(t, IsHttpVerb("post"))
|
||||
|
||||
Reference in New Issue
Block a user