mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-15 13:02:14 +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"`
|
Foo string `yaml:"foo" binding:"required"`
|
||||||
}
|
}
|
||||||
objYAML := typeYAML{}
|
objYAML := typeYAML{}
|
||||||
if tt.bindingBody != binding.YAML {
|
if tt.bindingBody != binding.YAML && tt.bindingBody != binding.JSON {
|
||||||
assert.Error(t, c.ShouldBindBodyWithYAML(&objYAML))
|
assert.Error(t, c.ShouldBindBodyWithYAML(&objYAML))
|
||||||
assert.Equal(t, typeYAML{}, objYAML)
|
assert.Equal(t, typeYAML{}, objYAML)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user