Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API versioning #60

Merged
merged 3 commits into from
Oct 5, 2020
Merged

Commits on Oct 1, 2020

  1. Update go.sum file

    sachinholla committed Oct 1, 2020
    Configuration menu
    Copy the full SHA
    33ee68e View commit details
    Browse the repository at this point in the history
  2. API versioning enhancements

    1) Enhanced REST server to accept the client version through new request
    header 'Accept-Version'. This is an optional header. If specified, it
    should be of Translib's yang bundle version format "Major.Minor.Patch".
    Server returns 400 status if Accept-Version value is invalid.
    
    2) Accept-Version header value is passed as "ClientVersion" value to the
    translib APIs. Translib version check errors are mapped to 400 status
    with error-type "protocol", error-tag "invalid-value" and an error-info
    json object indicating allowed version range (server version and server
    base version).
    
    Sameple error response payload:
      {
      "ietf-restconf:errors" : {
        "error" : [
          {
            "error-type" : "protocol",
            "error-tag" : "operation-not-supported",
            "error-message" : "Unsupported client version 0.0.1",
            "error-info" : {
              "version-error" : {
                "ServerBaseVersion" : "1.0.0",
                "ServerVersion" : "2.1.3",
                "ClientVersion" : "0.0.1"
              }
            }
          }]}}
    
    3) Translib version checks are not performed if client did not send the
    Accept-Version header.
    
    Signed-off-by: Sachin Holla <sachin.holla@broadcom.com>
    sachinholla committed Oct 1, 2020
    Configuration menu
    Copy the full SHA
    9946e68 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c1154e1 View commit details
    Browse the repository at this point in the history