From 62e0e95e28c1517522cd11badfc29b5a37dc04d2 Mon Sep 17 00:00:00 2001 From: Ghost Date: Tue, 12 Mar 2024 15:24:10 +0800 Subject: [PATCH] fix: yaml can parse json test case --- context_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context_test.go b/context_test.go index b3ebb2b7..83e95242 100644 --- a/context_test.go +++ b/context_test.go @@ -2118,7 +2118,7 @@ func TestContextShouldBindBodyWithYAML(t *testing.T) { Foo string `yaml:"foo" binding:"required"` } objYAML := typeYAML{} - if tt.bindingBody != binding.YAML { + if tt.bindingBody != binding.YAML && tt.bindingBody != binding.JSON { assert.Error(t, c.ShouldBindBodyWithYAML(&objYAML)) assert.Equal(t, typeYAML{}, objYAML) } else {