Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-7629

Parsing to protobuf leads to API call validation errors

    XMLWordPrintableJSON

Details

    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            greggomann Greg Mann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: