forked from loafle/openapi-generator-original
add accept header select to async method
This commit is contained in:
@@ -166,7 +166,17 @@ namespace {{packageName}}.Api
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
|
||||
// to determine the Accept header
|
||||
String[] http_header_accepts = new String[] {
|
||||
{{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
|
||||
};
|
||||
String http_header_accept = ApiClient.SelectHeaderAccept(http_header_accepts);
|
||||
if (http_header_accept != null)
|
||||
headerParams.Add("Accept", ApiClient.SelectHeaderAccept(http_header_accepts));
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
pathParams.Add("format", "json");
|
||||
{{#pathParams}}if ({{paramName}} != null) pathParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // path parameter
|
||||
{{/pathParams}}
|
||||
|
||||
Reference in New Issue
Block a user