We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I was writing the ShouldBindBodyWith shortcut, I tested that YAML would parse JSON BODY content, which should not be expected
func TestYAMLBindingBindBodyJSON(t *testing.T) { var s struct { Foo string `yaml:"foo"` } err := yamlBinding{}.BindBody([]byte(`{"foo":"FOO"}`), &s) require.Error(t, err) assert.Equal(t, "", s.Foo) }
=== RUN TestYAMLBindingBindBodyJSON --- PASS: TestYAMLBindingBindBodyJSON (0.00s) PASS
=== RUN TestYAMLBindingBindBodyJSON yaml_test.go:27: Error Trace: /Users/wenxingzhan/GolandProjects/gin/binding/yaml_test.go:27 Error: An error is expected but got nil. Test: TestYAMLBindingBindBodyJSON --- FAIL: TestYAMLBindingBindBodyJSON (0.00s) FAIL
The text was updated successfully, but these errors were encountered:
ShouldBindBodyWith()
I looked it up, and Red Hat says that YAML is a superset of JSON, and all the data can be parsed in JSON format.
Sorry, something went wrong.
No branches or pull requests
Description
When I was writing the ShouldBindBodyWith shortcut, I tested that YAML would parse JSON BODY content, which should not be expected
How to reproduce
Expectations
Actual result
Environment
The text was updated successfully, but these errors were encountered: