fix: yaml can parse json test case

This commit is contained in:
Ghost 2024-03-12 15:24:10 +08:00
parent 9eff3ec358
commit 62e0e95e28

View File

@ -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 {