Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
3
Description
The ::protobuf::parse() function will silently drop unrecognized fields, which makes sense in the context of maintaining backward-compatibility across different Mesos versions which may add or remove fields from protobuf messages. However, since we rely on this protobuf parsing in some places for validation of user-supplied JSON, this can lead to API endpoints returning successful 2XX responses, when in fact the JSON was malformed and the call has not been completed as submitted.
We should consider adding a parameter to API calls which allows users to enable/disable ignoring unrecognized fields in the call. If the default behavior for JSON requests was to return an error rather than ignore unrecognized fields, then our parsing code would catch malformed JSON submissions. The user could opt-in to the "ignore unrecognized fields" behavior when backwards compatibility is a concern.