chore: Strict request JSON check #37773
Draft
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.
Currently, if the incoming request body contains fields that aren't recognized by the backend, we just ignore them, and deserialize what we can. This has lead to subtle bugs and wasted a lot of developer time in the past, and added little value in return.
Most recently, with application creation, now fixed in #33722.
Another one, for action creation, client sends this in
eventData
field of the request body:But the class defined for
eventData
is this:Clearly isn't working.
This PR enabled the
FAIL_ON_UNKNOWN_PROPERTIES
setting only for the deserialization of HTTP request payloads. It shouldn't have impact on other deserializations like those for Git, and those that load resource files. Primarily to limit the scope.This should also bring in some much-needed type strictness to the client as well. So far, server has been lax in accepting just any fields in the incoming request body, so client was able to afford being lax about the object that was sent up.
Previously attempted at #33724.
Automation
/test sanity
🔍 Cypress test results
Caution
If you modify the content in this section, you are likely to disrupt the CI result for your PR.
Communication
Should the DevRel and Marketing teams inform users about this change?