Details
-
Improvement
-
Status: Reviewable
-
Major
-
Resolution: Unresolved
-
None
-
None
-
Studio 4: RI-21 61, Studio 4: RI-22 62, Studio 4: RI-22 63, Studio 4: RI-23 64
-
3
Description
When using the JSON content type with the HTTP APIs, a repeated protobuf field is omitted entirely from the JSON serialization of the message. For example, this is a response to the GetTasks call:
{ "get_tasks": { "tasks": [{...}] }, "type": "GET_TASKS" }
I think it would be better to include empty arrays for the other fields of the message (pending_tasks, completed_tasks, etc.). Advantages:
- Consistency with the old HTTP endpoints, e.g., /state
- Semantically, an empty array is more accurate. The master's response should be interpreted as saying it doesn't know about any pending/completed tasks; that is more accurately conveyed by explicitly including an empty array, not by omitting the key entirely.
NOTE: The asV1Protobuf copy needs to also be updated.
Attachments
Issue Links
- relates to
-
MESOS-9896 Consider using protobuf provided json conversion facilities rather than custom ones.
- Accepted