AllWatcherNextResults API schema differs from response

Bug #2025105 reported by Huw Wilkins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Medium
Simon Richardson

Bug Description

The AllWatcherNextResults Delta returned from AllModelWatcher and AllWatcher is defined in the schema.json as an object, but the API response is a tuple.

The schema.json has:
```
        "AllWatcherNextResults": {
          "type": "object",
          "properties": {
            "deltas": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Delta"
              }
            }
          },
          "additionalProperties": false,
          "required": ["deltas"]
        },
        "Delta": {
          "type": "object",
          "properties": {
            "entity": {
              "type": "object",
              "additionalProperties": true
            },
            "removed": {
              "type": "boolean"
            }
          },
          "additionalProperties": false,
          "required": ["removed", "entity"]
        }
      }
```

The actual response is a tuple in the format ["entity type string", "change type string", {delta object}] e.g.

```
{
  "request-id": 1,
  "response": {
    "deltas": [
      [
        "model",
        "change",
        {
          "model-uuid": "123",
          ...
        }
      ],
      ...
    ]
  }
}
```

This is seen in 3.x but is also the same for 2.9.

Revision history for this message
Harry Pidcock (hpidcock) wrote :

Unfortunately I think there is some special encoding going on for Delta, you can see it in MarshalJSON() in rpc/params/multiwatcher.go

Changed in juju:
status: New → Triaged
importance: Undecided → Medium
Changed in juju:
assignee: nobody → Simon Richardson (simonrichardson)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.