Uploaded image for project: 'Traffic Control'
  1. Traffic Control
  2. TC-28

API response structure should be hierarchical instead of flat

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 1.8.0
    • 1.8.0
    • Traffic Ops API
    • None

    Description

      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.

      Attachments

        Activity

          People

            mitchell852@apache.org Jeremy Mitchell
            mitchell852@apache.org Jeremy Mitchell
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: