mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-15 21:06:39 +08:00
fix: yaml can parse json test case
This commit is contained in:
parent
9eff3ec358
commit
62e0e95e28
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user