forked from loafle/openapi-generator-original
Merge pull request #1450 from paralin/fix-path-var
Change usage of "path" in C# code generation
This commit is contained in:
commit
55f1b0f642
@ -102,7 +102,7 @@ namespace {{packageName}}.Api
|
|||||||
if ({{paramName}} == null) throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{nickname}}");
|
if ({{paramName}} == null) throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{nickname}}");
|
||||||
{{/required}}{{/allParams}}
|
{{/required}}{{/allParams}}
|
||||||
|
|
||||||
var path = "{{path}}";
|
var path_ = "{{path}}";
|
||||||
|
|
||||||
var pathParams = new Dictionary<String, String>();
|
var pathParams = new Dictionary<String, String>();
|
||||||
var queryParams = new Dictionary<String, String>();
|
var queryParams = new Dictionary<String, String>();
|
||||||
@ -137,7 +137,7 @@ namespace {{packageName}}.Api
|
|||||||
String[] authSettings = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
String[] authSettings = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
||||||
|
|
||||||
// make the HTTP request
|
// make the HTTP request
|
||||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.{{httpMethod}}, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
IRestResponse response = (IRestResponse) ApiClient.CallApi(path_, Method.{{httpMethod}}, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||||
|
|
||||||
if (((int)response.StatusCode) >= 400)
|
if (((int)response.StatusCode) >= 400)
|
||||||
throw new ApiException ((int)response.StatusCode, "Error calling {{nickname}}: " + response.Content, response.Content);
|
throw new ApiException ((int)response.StatusCode, "Error calling {{nickname}}: " + response.Content, response.Content);
|
||||||
@ -158,7 +158,7 @@ namespace {{packageName}}.Api
|
|||||||
if ({{paramName}} == null) throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{nickname}}");
|
if ({{paramName}} == null) throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{nickname}}");
|
||||||
{{/required}}{{/allParams}}
|
{{/required}}{{/allParams}}
|
||||||
|
|
||||||
var path = "{{path}}";
|
var path_ = "{{path}}";
|
||||||
|
|
||||||
var pathParams = new Dictionary<String, String>();
|
var pathParams = new Dictionary<String, String>();
|
||||||
var queryParams = new Dictionary<String, String>();
|
var queryParams = new Dictionary<String, String>();
|
||||||
@ -193,7 +193,7 @@ namespace {{packageName}}.Api
|
|||||||
String[] authSettings = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
String[] authSettings = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
||||||
|
|
||||||
// make the HTTP request
|
// make the HTTP request
|
||||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.{{httpMethod}}, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path_, Method.{{httpMethod}}, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||||
if (((int)response.StatusCode) >= 400)
|
if (((int)response.StatusCode) >= 400)
|
||||||
throw new ApiException ((int)response.StatusCode, "Error calling {{nickname}}: " + response.Content, response.Content);
|
throw new ApiException ((int)response.StatusCode, "Error calling {{nickname}}: " + response.Content, response.Content);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user