Ignore unknown JSON fields when decoding requests.#60
Merged
marioizquierdo merged 2 commits intoarthurnn:masterfrom Nov 5, 2020
Merged
Ignore unknown JSON fields when decoding requests.#60marioizquierdo merged 2 commits intoarthurnn:masterfrom
marioizquierdo merged 2 commits intoarthurnn:masterfrom
Conversation
In version 3.7 of protobufs the option to ignore unknown JSON fields was added. Setting this flag to true makes it so JSON encoded requests can be mostly backwards compatible just like existing protobuf encoding.
marioizquierdo
approved these changes
Nov 5, 2020
Collaborator
marioizquierdo
left a comment
There was a problem hiding this comment.
LGTM.
It would be great to be able to ignore unknown fields for client requests, but fail for curl requests, because that helps with debugging, which is what JSON encoding is mainly trying to help with. But doing so would require more work and updating the protocol which is probably not worth it. This looks good, thanks!
Contributor
Author
|
Ya if we did want to do that, we could add a JSON_STRICT and did the content type thing I was talking about of 'application/json; strict=true' |
Contributor
Author
|
I sent a PR for this #61 @marioizquierdo We can decide not to do it just wanted to throw it out there. I kind of like it to be honest. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In version 3.7 of protobufs the option to ignore unknown JSON fields was
added. Setting this flag to true makes it so JSON encoded requests can be
mostly backwards compatible just like existing protobuf encoding.
This fixes #59.