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:
Dave Shanley
2023-06-16 06:54:54 -04:00
committed by quobix
parent fcf2f332d9
commit 5b128c098a
7 changed files with 85 additions and 33 deletions

View File

@@ -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"))