rob05c commented on issue #2872: RFE: Add supported API versions API
URL: https://github.com/apache/trafficcontrol/issues/2872#issuecomment-436709906
 
 
   +1
   
   `OPTIONS` isn't well-defined, so anything it returns is going to be 
proprietary. But I'm not strictly opposed to it.
   
   Which makes me agree, since it isn't well-defined, returning something as 
simple as possible is best.
   
   It seems verbose, and a lot of duplication, but it makes it as easy as 
possible to use, e.g. users can simply `string.Find(myRoute)` or 
`string.Find("api/1.5")` to determine if a route or API version exists. And 
duplicate text compresses extremely well, so the gzip will be small.
   
   Since the API itself is JSON, I'd also support returning JSON if the client 
sends an `Accept: application/json` header. Something like:
   ```
   { "api": "1.2",
     "routes": [ 
       { "path": "/cdns",
         "methods": ["GET", "POST"] }, 
       { "path": "/deliveryservices/{{id}}/sslkeys",
         "methods": ["GET"],
         "example": "GET /api/1.2/deliveryservices/42/sslkeys"}, 
       ]
     }
   }
   ```
   
   I don't think the structure is necessary here, to warrant the parsing 
complexity. But since the API is JSON, it might make it a little easier for 
some users, to use the same decode function for everything.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to