trafficcontrol
trafficcontrol copied to clipboard
POST and PUT responses from /deliveryservices and /deliveryservices/{{ID}} are arrays
This Improvement request (usability, performance, tech debt, etc.) affects these Traffic Control components:
- Traffic Ops
Current behavior:
The response type of requests to create and update Delivery Services is an array of one Delivery Service. I'm not sure if this was always the case.
New behavior:
Per the API guidelines:
When an object is created, the response body MUST contain a representation of the newly created object.
and
When an object is replaced, the response body MUST contain a representation of the object after replacement.
since the object created or updated is not an array but actually the single element of what is currently an array, the response should not be an array but simply the single object.
Note that this is a breaking API change; cannot be done in APIv3 (or probably v4 which is set to be released any day now).