You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by "Jeremy Mitchell (JIRA)" <ji...@apache.org> on 2016/11/08 15:52:58 UTC
[jira] [Closed] (TC-28) API response structure should be
hierarchical instead of flat
[ https://issues.apache.org/jira/browse/TC-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jeremy Mitchell closed TC-28.
-----------------------------
Assignee: Jeremy Mitchell
> API response structure should be hierarchical instead of flat
> -------------------------------------------------------------
>
> Key: TC-28
> URL: https://issues.apache.org/jira/browse/TC-28
> Project: Traffic Control
> Issue Type: Improvement
> Components: Traffic Ops API
> Affects Versions: 1.8.0
> Reporter: Jeremy Mitchell
> Assignee: Jeremy Mitchell
> Priority: Minor
> Fix For: 1.8.0
>
>
> I created a handful of api endpoints in 1.8 with a flat response structure like:
> {
> "response": [
> {
> "asn": "23",
> "cachegroupId": "69",
> "cachegroupName": "Foo_Cachegroup",
> "id": "60",
> "lastUpdated": "2016-10-13 12:31:43"
> }
> ]
> }
> Although this is fine, it makes it more difficult to test when using structures derived from the database. This structure is more friendly.
> {
> "response": [
> {
> "asn": "23",
> "cachegroup": {
> "id": "69",
> "name": "Aberdeen_17802B_Ciscos"
> },
> "id": "60",
> "lastUpdated": "2016-10-13 12:31:43"
> }
> ]
> }
> This nested structure needs to be applied to api endpoints related to asn, cachegroup, deliveryservice, phys_location, region, server and user.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)