Forum Discussion

nikhilnayyar's avatar
6 years ago

Unable to override the server for a specific path (Open API swagger specification)

Open Api Json specification:

 

{

..

..

 "host":"account-d.docusign.com",
 "basePath":"/oauth/",
 "schemes":[
   "https"
  ],

..

..

 "paths":{

..

..

    "/restapi/v2/accounts/{account_id}": {

     ..

     ..

 }

..

..

}

 

Above for this specific path i dont have the server host name. I get it as workflow progresses in nintex. I have used this OpenApi spec above (not completely shown) in nintex custom connector for docusign. At some point in workflow i retrieve user's baseUrl (required for making calls to user's rest api). This base url is not fixed. I retrieve it and want it to be templated as server in openApi specification i provided above. OpenApi already supports 

Path Templating

 

You can use curly braces {} to mark parts of an URL as path parameters:

 

  1. /users/{id}
  2. /organizations/{orgId}/members/{memberId}
  3. /report.{format}

The API client needs to provide appropriate parameter values when making an API call, such as /users/5 or /users/12.

 

------------------------------------------------------

 

Can same templating be done for servers. I have gone through article overriding server array in openApi swagger spec but its not seems to be useful as it is not templating but is static.

 

Thanks

No RepliesBe the first to reply