-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
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
Remove deny_unknown_fields
from Request
and Response
#803
Remove deny_unknown_fields
from Request
and Response
#803
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but we should do the same for the Response
for consistency.
It's not that likely that other servers impls will add custom fields but better safe than sorry I guess.
I'm happy if we don't have to use more feature flags than necessary :)
deny_unknown_fields
from Request
deny_unknown_fields
from Request
and Response
@@ -545,7 +545,7 @@ async fn invalid_request_should_not_close_connection() { | |||
let addr = server().await; | |||
let mut client = WebSocketTestClient::new(addr).with_default_timeout().await.unwrap().unwrap(); | |||
|
|||
let req = r#"{"jsonrpc":"2.0","method":"bar","id":1,"is_not_request_object":1}"#; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a quick test just to prove that something like {"jsonrpc":"2.0","method":"bar","id":1,"is_not_request_object":1}
is now valid and catch any regresstions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test might be nice but not too important, so LGTM :)
…h#803) * Remove `deny_unknown_fields` * Update invalid request tests * Remove `is_not_request_object` field from req in test * Remove `deny_unknown_fields` from `Response` * Add test to verify unknown field results in valid request
…h#803) * Remove `deny_unknown_fields` * Update invalid request tests * Remove `is_not_request_object` field from req in test * Remove `deny_unknown_fields` from `Response` * Add test to verify unknown field results in valid request
Solves #797
@niklasad1 please let me know if this is prefered over keeping optional
deny_unknown_fields
behind a feature.