forked from loafle/openapi-generator-original
remove leading space for path variable, update unit test
This commit is contained in:
parent
a863e538a8
commit
596bde2ef6
@ -104,11 +104,11 @@ namespace {{packageName}}.Api
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
{{#pathParams}} if ({{paramName}} != null) pathParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // path parameter
|
||||
{{#pathParams}}if ({{paramName}} != null) pathParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // path parameter
|
||||
{{/pathParams}}
|
||||
{{#queryParams}} if ({{paramName}} != null) queryParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // query parameter
|
||||
{{#queryParams}}if ({{paramName}} != null) queryParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // query parameter
|
||||
{{/queryParams}}
|
||||
{{#headerParams}} if ({{paramName}} != null) headerParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // header parameter
|
||||
{{#headerParams}}if ({{paramName}} != null) headerParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // header parameter
|
||||
{{/headerParams}}
|
||||
{{#formParams}}if ({{paramName}} != null) {{#isFile}}fileParams.Add("{{baseName}}", ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}formParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // form parameter{{/isFile}}
|
||||
{{/formParams}}
|
||||
@ -150,11 +150,11 @@ namespace {{packageName}}.Api
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
{{#pathParams}} if ({{paramName}} != null) pathParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // path parameter
|
||||
{{#pathParams}}if ({{paramName}} != null) pathParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // path parameter
|
||||
{{/pathParams}}
|
||||
{{#queryParams}} if ({{paramName}} != null) queryParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // query parameter
|
||||
{{#queryParams}}if ({{paramName}} != null) queryParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // query parameter
|
||||
{{/queryParams}}
|
||||
{{#headerParams}} if ({{paramName}} != null) headerParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // header parameter
|
||||
{{#headerParams}}if ({{paramName}} != null) headerParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // header parameter
|
||||
{{/headerParams}}
|
||||
{{#formParams}}if ({{paramName}} != null) {{#isFile}}fileParams.Add("{{baseName}}", ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}formParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // form parameter{{/isFile}}
|
||||
{{/formParams}}
|
||||
|
@ -102,18 +102,18 @@ namespace IO.Swagger.Api
|
||||
/// <summary>
|
||||
/// Deletes a pet
|
||||
/// </summary>
|
||||
/// <param name="apiKey"></param>
|
||||
/// <param name="petId">Pet id to delete</param>
|
||||
/// <param name="apiKey"></param>
|
||||
/// <returns></returns>
|
||||
void DeletePet (string apiKey, long? petId);
|
||||
void DeletePet (long? petId, string apiKey);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a pet
|
||||
/// </summary>
|
||||
/// <param name="apiKey"></param>
|
||||
/// <param name="petId">Pet id to delete</param>
|
||||
/// <param name="apiKey"></param>
|
||||
/// <returns></returns>
|
||||
System.Threading.Tasks.Task DeletePetAsync (string apiKey, long? petId);
|
||||
System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey);
|
||||
|
||||
/// <summary>
|
||||
/// uploads an image
|
||||
@ -199,15 +199,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/pet";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -218,7 +219,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "petstore_auth" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.Content, response.Content);
|
||||
@ -238,15 +239,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/pet";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -257,7 +259,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "petstore_auth" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.Content, response.Content);
|
||||
|
||||
@ -275,15 +277,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/pet";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -294,7 +297,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "petstore_auth" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.Content, response.Content);
|
||||
@ -314,15 +317,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/pet";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -333,7 +337,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "petstore_auth" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.Content, response.Content);
|
||||
|
||||
@ -351,15 +355,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/pet/findByStatus";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
if (status != null) queryParams.Add("status", ApiClient.ParameterToString(status)); // query parameter
|
||||
|
||||
|
||||
@ -370,7 +375,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "petstore_auth" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content);
|
||||
@ -390,15 +395,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/pet/findByStatus";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
if (status != null) queryParams.Add("status", ApiClient.ParameterToString(status)); // query parameter
|
||||
|
||||
|
||||
@ -409,7 +415,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "petstore_auth" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content);
|
||||
|
||||
@ -426,15 +432,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/pet/findByTags";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
if (tags != null) queryParams.Add("tags", ApiClient.ParameterToString(tags)); // query parameter
|
||||
|
||||
|
||||
@ -445,7 +452,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "petstore_auth" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content);
|
||||
@ -465,15 +472,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/pet/findByTags";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
if (tags != null) queryParams.Add("tags", ApiClient.ParameterToString(tags)); // query parameter
|
||||
|
||||
|
||||
@ -484,7 +492,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "petstore_auth" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content);
|
||||
|
||||
@ -504,16 +512,17 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/pet/{petId}";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (petId != null) pathParams.Add("petId", ApiClient.ParameterToString(petId)); // path parameter
|
||||
|
||||
|
||||
|
||||
|
||||
@ -523,7 +532,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "api_key", "petstore_auth" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.Content, response.Content);
|
||||
@ -545,16 +554,17 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/pet/{petId}";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (petId != null) pathParams.Add("petId", ApiClient.ParameterToString(petId)); // path parameter
|
||||
|
||||
|
||||
|
||||
|
||||
@ -564,7 +574,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "api_key", "petstore_auth" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.Content, response.Content);
|
||||
|
||||
@ -586,16 +596,17 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/pet/{petId}";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (petId != null) pathParams.Add("petId", ApiClient.ParameterToString(petId)); // path parameter
|
||||
|
||||
|
||||
|
||||
if (name != null) formParams.Add("name", ApiClient.ParameterToString(name)); // form parameter
|
||||
@ -607,7 +618,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "petstore_auth" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content);
|
||||
@ -631,16 +642,17 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/pet/{petId}";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (petId != null) pathParams.Add("petId", ApiClient.ParameterToString(petId)); // path parameter
|
||||
|
||||
|
||||
|
||||
if (name != null) formParams.Add("name", ApiClient.ParameterToString(name)); // form parameter
|
||||
@ -652,7 +664,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "petstore_auth" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content);
|
||||
|
||||
@ -663,10 +675,10 @@ namespace IO.Swagger.Api
|
||||
/// <summary>
|
||||
/// Deletes a pet
|
||||
/// </summary>
|
||||
/// <param name="apiKey"></param>
|
||||
/// <param name="petId">Pet id to delete</param>
|
||||
/// <param name="apiKey"></param>
|
||||
/// <returns></returns>
|
||||
public void DeletePet (string apiKey, long? petId)
|
||||
public void DeletePet (long? petId, string apiKey)
|
||||
{
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
@ -674,16 +686,17 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/pet/{petId}";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (petId != null) pathParams.Add("petId", ApiClient.ParameterToString(petId)); // path parameter
|
||||
|
||||
|
||||
if (apiKey != null) headerParams.Add("api_key", ApiClient.ParameterToString(apiKey)); // header parameter
|
||||
|
||||
@ -694,7 +707,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "petstore_auth" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.Content, response.Content);
|
||||
@ -707,26 +720,27 @@ namespace IO.Swagger.Api
|
||||
/// <summary>
|
||||
/// Deletes a pet
|
||||
/// </summary>
|
||||
/// <param name="apiKey"></param>
|
||||
/// <param name="petId">Pet id to delete</param>
|
||||
/// <param name="apiKey"></param>
|
||||
/// <returns></returns>
|
||||
public async System.Threading.Tasks.Task DeletePetAsync (string apiKey, long? petId)
|
||||
public async System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey)
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling DeletePet");
|
||||
|
||||
|
||||
var path = "/pet/{petId}";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (petId != null) pathParams.Add("petId", ApiClient.ParameterToString(petId)); // path parameter
|
||||
|
||||
|
||||
if (apiKey != null) headerParams.Add("api_key", ApiClient.ParameterToString(apiKey)); // header parameter
|
||||
|
||||
@ -737,7 +751,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "petstore_auth" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.Content, response.Content);
|
||||
|
||||
@ -760,16 +774,17 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/pet/{petId}/uploadImage";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (petId != null) pathParams.Add("petId", ApiClient.ParameterToString(petId)); // path parameter
|
||||
|
||||
|
||||
|
||||
if (additionalMetadata != null) formParams.Add("additionalMetadata", ApiClient.ParameterToString(additionalMetadata)); // form parameter
|
||||
@ -781,7 +796,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "petstore_auth" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.Content, response.Content);
|
||||
@ -805,16 +820,17 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/pet/{petId}/uploadImage";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (petId != null) pathParams.Add("petId", ApiClient.ParameterToString(petId)); // path parameter
|
||||
|
||||
|
||||
|
||||
if (additionalMetadata != null) formParams.Add("additionalMetadata", ApiClient.ParameterToString(additionalMetadata)); // form parameter
|
||||
@ -826,7 +842,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "petstore_auth" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.Content, response.Content);
|
||||
|
||||
|
@ -130,15 +130,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/store/inventory";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -148,7 +149,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "api_key" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.Content, response.Content);
|
||||
@ -167,15 +168,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/store/inventory";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -185,7 +187,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { "api_key" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.Content, response.Content);
|
||||
|
||||
@ -202,15 +204,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/store/order";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -221,7 +224,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content);
|
||||
@ -241,15 +244,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/store/order";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -260,7 +264,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content);
|
||||
|
||||
@ -280,16 +284,17 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/store/order/{orderId}";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (orderId != null) pathParams.Add("orderId", ApiClient.ParameterToString(orderId)); // path parameter
|
||||
|
||||
|
||||
|
||||
|
||||
@ -299,7 +304,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.Content, response.Content);
|
||||
@ -321,16 +326,17 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/store/order/{orderId}";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (orderId != null) pathParams.Add("orderId", ApiClient.ParameterToString(orderId)); // path parameter
|
||||
|
||||
|
||||
|
||||
|
||||
@ -340,7 +346,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.Content, response.Content);
|
||||
|
||||
@ -360,16 +366,17 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/store/order/{orderId}";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (orderId != null) pathParams.Add("orderId", ApiClient.ParameterToString(orderId)); // path parameter
|
||||
|
||||
|
||||
|
||||
|
||||
@ -379,7 +386,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.Content, response.Content);
|
||||
@ -401,16 +408,17 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/store/order/{orderId}";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (orderId != null) pathParams.Add("orderId", ApiClient.ParameterToString(orderId)); // path parameter
|
||||
|
||||
|
||||
|
||||
|
||||
@ -420,7 +428,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.Content, response.Content);
|
||||
|
||||
|
@ -191,15 +191,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/user";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -210,7 +211,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.Content, response.Content);
|
||||
@ -230,15 +231,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/user";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -249,7 +251,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.Content, response.Content);
|
||||
|
||||
@ -267,15 +269,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/user/createWithArray";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -286,7 +289,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.Content, response.Content);
|
||||
@ -306,15 +309,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/user/createWithArray";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -325,7 +329,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.Content, response.Content);
|
||||
|
||||
@ -343,15 +347,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/user/createWithList";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -362,7 +367,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.Content, response.Content);
|
||||
@ -382,15 +387,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/user/createWithList";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -401,7 +407,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.Content, response.Content);
|
||||
|
||||
@ -420,15 +426,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/user/login";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
if (username != null) queryParams.Add("username", ApiClient.ParameterToString(username)); // query parameter
|
||||
if (password != null) queryParams.Add("password", ApiClient.ParameterToString(password)); // query parameter
|
||||
|
||||
@ -440,7 +447,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.Content, response.Content);
|
||||
@ -461,15 +468,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/user/login";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
if (username != null) queryParams.Add("username", ApiClient.ParameterToString(username)); // query parameter
|
||||
if (password != null) queryParams.Add("password", ApiClient.ParameterToString(password)); // query parameter
|
||||
|
||||
@ -481,7 +489,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.Content, response.Content);
|
||||
|
||||
@ -497,15 +505,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/user/logout";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -515,7 +524,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.Content, response.Content);
|
||||
@ -534,15 +543,16 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/user/logout";
|
||||
path = path.Replace("{format}", "json");
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
@ -552,7 +562,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.Content, response.Content);
|
||||
|
||||
@ -573,16 +583,17 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/user/{username}";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (username != null) pathParams.Add("username", ApiClient.ParameterToString(username)); // path parameter
|
||||
|
||||
|
||||
|
||||
|
||||
@ -592,7 +603,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.Content, response.Content);
|
||||
@ -614,16 +625,17 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/user/{username}";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (username != null) pathParams.Add("username", ApiClient.ParameterToString(username)); // path parameter
|
||||
|
||||
|
||||
|
||||
|
||||
@ -633,7 +645,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.Content, response.Content);
|
||||
|
||||
@ -654,16 +666,17 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/user/{username}";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (username != null) pathParams.Add("username", ApiClient.ParameterToString(username)); // path parameter
|
||||
|
||||
|
||||
|
||||
|
||||
@ -674,7 +687,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.Content, response.Content);
|
||||
@ -697,16 +710,17 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/user/{username}";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (username != null) pathParams.Add("username", ApiClient.ParameterToString(username)); // path parameter
|
||||
|
||||
|
||||
|
||||
|
||||
@ -717,7 +731,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.Content, response.Content);
|
||||
|
||||
@ -738,16 +752,17 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/user/{username}";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (username != null) pathParams.Add("username", ApiClient.ParameterToString(username)); // path parameter
|
||||
|
||||
|
||||
|
||||
|
||||
@ -757,7 +772,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.Content, response.Content);
|
||||
@ -779,16 +794,17 @@ namespace IO.Swagger.Api
|
||||
|
||||
|
||||
var path = "/user/{username}";
|
||||
path = path.Replace("{format}", "json");
|
||||
path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username));
|
||||
|
||||
|
||||
var pathParams = new Dictionary<String, String>();
|
||||
var queryParams = new Dictionary<String, String>();
|
||||
var headerParams = new Dictionary<String, String>();
|
||||
var formParams = new Dictionary<String, String>();
|
||||
var fileParams = new Dictionary<String, FileParameter>();
|
||||
String postBody = null;
|
||||
|
||||
pathParams.Add("format", "json");
|
||||
if (username != null) pathParams.Add("username", ApiClient.ParameterToString(username)); // path parameter
|
||||
|
||||
|
||||
|
||||
|
||||
@ -798,7 +814,7 @@ namespace IO.Swagger.Api
|
||||
String[] authSettings = new String[] { };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
if (((int)response.StatusCode) >= 400)
|
||||
throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.Content, response.Content);
|
||||
|
||||
|
@ -50,23 +50,12 @@ namespace IO.Swagger.Client
|
||||
get { return _defaultHeaderMap; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Makes the HTTP request (Sync).
|
||||
/// </summary>
|
||||
/// <param name="path">URL path.</param>
|
||||
/// <param name="method">HTTP method.</param>
|
||||
/// <param name="queryParams">Query parameters.</param>
|
||||
/// <param name="postBody">HTTP body (POST request).</param>
|
||||
/// <param name="headerParams">Header parameters.</param>
|
||||
/// <param name="formParams">Form parameters.</param>
|
||||
/// <param name="fileParams">File parameters.</param>
|
||||
/// <param name="authSettings">Authentication settings.</param>
|
||||
/// <returns>Object</returns>
|
||||
public Object CallApi(String path, RestSharp.Method method, Dictionary<String, String> queryParams, String postBody,
|
||||
// Creates and sets up a RestRequest prior to a call.
|
||||
private RestRequest PrepareRequest(
|
||||
String path, RestSharp.Method method, Dictionary<String, String> queryParams, String postBody,
|
||||
Dictionary<String, String> headerParams, Dictionary<String, String> formParams,
|
||||
Dictionary<String, FileParameter> fileParams, String[] authSettings)
|
||||
Dictionary<String, FileParameter> fileParams, Dictionary<String, String> pathParams, String[] authSettings)
|
||||
{
|
||||
|
||||
var request = new RestRequest(path, method);
|
||||
|
||||
UpdateParamsForAuth(queryParams, headerParams, authSettings);
|
||||
@ -75,6 +64,10 @@ namespace IO.Swagger.Client
|
||||
foreach(var defaultHeader in _defaultHeaderMap)
|
||||
request.AddHeader(defaultHeader.Key, defaultHeader.Value);
|
||||
|
||||
// add path parameter, if any
|
||||
foreach(var param in pathParams)
|
||||
request.AddParameter(param.Key, param.Value, ParameterType.UrlSegment);
|
||||
|
||||
// add header parameter, if any
|
||||
foreach(var param in headerParams)
|
||||
request.AddHeader(param.Key, param.Value);
|
||||
@ -94,8 +87,30 @@ namespace IO.Swagger.Client
|
||||
if (postBody != null) // http body (model) parameter
|
||||
request.AddParameter("application/json", postBody, ParameterType.RequestBody);
|
||||
|
||||
return (Object)RestClient.Execute(request);
|
||||
return request;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Makes the HTTP request (Sync).
|
||||
/// </summary>
|
||||
/// <param name="path">URL path.</param>
|
||||
/// <param name="method">HTTP method.</param>
|
||||
/// <param name="queryParams">Query parameters.</param>
|
||||
/// <param name="postBody">HTTP body (POST request).</param>
|
||||
/// <param name="headerParams">Header parameters.</param>
|
||||
/// <param name="formParams">Form parameters.</param>
|
||||
/// <param name="fileParams">File parameters.</param>
|
||||
/// <param name="pathParams">Path parameters.</param>
|
||||
/// <param name="authSettings">Authentication settings.</param>
|
||||
/// <returns>Object</returns>
|
||||
public Object CallApi(
|
||||
String path, RestSharp.Method method, Dictionary<String, String> queryParams, String postBody,
|
||||
Dictionary<String, String> headerParams, Dictionary<String, String> formParams,
|
||||
Dictionary<String, FileParameter> fileParams, Dictionary<String, String> pathParams, String[] authSettings)
|
||||
{
|
||||
var request = PrepareRequest(
|
||||
path, method, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
return (Object)RestClient.Execute(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -108,39 +123,16 @@ namespace IO.Swagger.Client
|
||||
/// <param name="headerParams">Header parameters.</param>
|
||||
/// <param name="formParams">Form parameters.</param>
|
||||
/// <param name="fileParams">File parameters.</param>
|
||||
/// <param name="pathParams">Path parameters.</param>
|
||||
/// <param name="authSettings">Authentication settings.</param>
|
||||
/// <returns>The Task instance.</returns>
|
||||
public async System.Threading.Tasks.Task<Object> CallApiAsync(String path, RestSharp.Method method, Dictionary<String, String> queryParams, String postBody,
|
||||
Dictionary<String, String> headerParams, Dictionary<String, String> formParams, Dictionary<String, FileParameter> fileParams, String[] authSettings)
|
||||
public async System.Threading.Tasks.Task<Object> CallApiAsync(
|
||||
String path, RestSharp.Method method, Dictionary<String, String> queryParams, String postBody,
|
||||
Dictionary<String, String> headerParams, Dictionary<String, String> formParams,
|
||||
Dictionary<String, FileParameter> fileParams, Dictionary<String, String> pathParams, String[] authSettings)
|
||||
{
|
||||
|
||||
var request = new RestRequest(path, method);
|
||||
|
||||
UpdateParamsForAuth(queryParams, headerParams, authSettings);
|
||||
|
||||
// add default header, if any
|
||||
foreach(var defaultHeader in _defaultHeaderMap)
|
||||
request.AddHeader(defaultHeader.Key, defaultHeader.Value);
|
||||
|
||||
// add header parameter, if any
|
||||
foreach(var param in headerParams)
|
||||
request.AddHeader(param.Key, param.Value);
|
||||
|
||||
// add query parameter, if any
|
||||
foreach(var param in queryParams)
|
||||
request.AddQueryParameter(param.Key, param.Value);
|
||||
|
||||
// add form parameter, if any
|
||||
foreach(var param in formParams)
|
||||
request.AddParameter(param.Key, param.Value);
|
||||
|
||||
// add file parameter, if any
|
||||
foreach(var param in fileParams)
|
||||
request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType);
|
||||
|
||||
if (postBody != null) // http body (model) parameter
|
||||
request.AddParameter("application/json", postBody, ParameterType.RequestBody);
|
||||
|
||||
var request = PrepareRequest(
|
||||
path, method, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
|
||||
return (Object) await RestClient.ExecuteTaskAsync(request);
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="TestPet.cs">
|
||||
<Files>
|
||||
<File FileName="TestPet.cs" Line="28" Column="64" />
|
||||
<File FileName="TestPet.cs" Line="68" Column="30" />
|
||||
</Files>
|
||||
</MonoDevelop.Ide.Workbench>
|
||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
|
@ -45,7 +45,7 @@ namespace SwaggerClient.TestPet
|
||||
{
|
||||
// remove the pet after testing
|
||||
PetApi petApi = new PetApi ();
|
||||
petApi.DeletePet("test key", petId);
|
||||
petApi.DeletePet(petId, "test key");
|
||||
}
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
112
samples/client/petstore/csharp/SwaggerClientTest/packages/Newtonsoft.Json.7.0.1/tools/install.ps1
vendored
Normal file
112
samples/client/petstore/csharp/SwaggerClientTest/packages/Newtonsoft.Json.7.0.1/tools/install.ps1
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
param($installPath, $toolsPath, $package, $project)
|
||||
|
||||
# open json.net splash page on package install
|
||||
# don't open if json.net is installed as a dependency
|
||||
|
||||
try
|
||||
{
|
||||
$url = "http://www.newtonsoft.com/json/install?version=" + $package.Version
|
||||
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
|
||||
|
||||
if ($dte2.ActiveWindow.Caption -eq "Package Manager Console")
|
||||
{
|
||||
# user is installing from VS NuGet console
|
||||
# get reference to the window, the console host and the input history
|
||||
# show webpage if "install-package newtonsoft.json" was last input
|
||||
|
||||
$consoleWindow = $(Get-VSComponentModel).GetService([NuGetConsole.IPowerConsoleWindow])
|
||||
|
||||
$props = $consoleWindow.GetType().GetProperties([System.Reflection.BindingFlags]::Instance -bor `
|
||||
[System.Reflection.BindingFlags]::NonPublic)
|
||||
|
||||
$prop = $props | ? { $_.Name -eq "ActiveHostInfo" } | select -first 1
|
||||
if ($prop -eq $null) { return }
|
||||
|
||||
$hostInfo = $prop.GetValue($consoleWindow)
|
||||
if ($hostInfo -eq $null) { return }
|
||||
|
||||
$history = $hostInfo.WpfConsole.InputHistory.History
|
||||
|
||||
$lastCommand = $history | select -last 1
|
||||
|
||||
if ($lastCommand)
|
||||
{
|
||||
$lastCommand = $lastCommand.Trim().ToLower()
|
||||
if ($lastCommand.StartsWith("install-package") -and $lastCommand.Contains("newtonsoft.json"))
|
||||
{
|
||||
$dte2.ItemOperations.Navigate($url) | Out-Null
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# user is installing from VS NuGet dialog
|
||||
# get reference to the window, then smart output console provider
|
||||
# show webpage if messages in buffered console contains "installing...newtonsoft.json" in last operation
|
||||
|
||||
$instanceField = [NuGet.Dialog.PackageManagerWindow].GetField("CurrentInstance", [System.Reflection.BindingFlags]::Static -bor `
|
||||
[System.Reflection.BindingFlags]::NonPublic)
|
||||
|
||||
$consoleField = [NuGet.Dialog.PackageManagerWindow].GetField("_smartOutputConsoleProvider", [System.Reflection.BindingFlags]::Instance -bor `
|
||||
[System.Reflection.BindingFlags]::NonPublic)
|
||||
|
||||
if ($instanceField -eq $null -or $consoleField -eq $null) { return }
|
||||
|
||||
$instance = $instanceField.GetValue($null)
|
||||
|
||||
if ($instance -eq $null) { return }
|
||||
|
||||
$consoleProvider = $consoleField.GetValue($instance)
|
||||
if ($consoleProvider -eq $null) { return }
|
||||
|
||||
$console = $consoleProvider.CreateOutputConsole($false)
|
||||
|
||||
$messagesField = $console.GetType().GetField("_messages", [System.Reflection.BindingFlags]::Instance -bor `
|
||||
[System.Reflection.BindingFlags]::NonPublic)
|
||||
if ($messagesField -eq $null) { return }
|
||||
|
||||
$messages = $messagesField.GetValue($console)
|
||||
if ($messages -eq $null) { return }
|
||||
|
||||
$operations = $messages -split "=============================="
|
||||
|
||||
$lastOperation = $operations | select -last 1
|
||||
|
||||
if ($lastOperation)
|
||||
{
|
||||
$lastOperation = $lastOperation.ToLower()
|
||||
|
||||
$lines = $lastOperation -split "`r`n"
|
||||
|
||||
$installMatch = $lines | ? { $_.StartsWith("------- installing...newtonsoft.json ") } | select -first 1
|
||||
|
||||
if ($installMatch)
|
||||
{
|
||||
$dte2.ItemOperations.Navigate($url) | Out-Null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
try
|
||||
{
|
||||
$pmPane = $dte2.ToolWindows.OutputWindow.OutputWindowPanes.Item("Package Manager")
|
||||
|
||||
$selection = $pmPane.TextDocument.Selection
|
||||
$selection.StartOfDocument($false)
|
||||
$selection.EndOfDocument($true)
|
||||
|
||||
if ($selection.Text.StartsWith("Attempting to gather dependencies information for package 'Newtonsoft.Json." + $package.Version + "'"))
|
||||
{
|
||||
$dte2.ItemOperations.Navigate($url) | Out-Null
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
# stop potential errors from bubbling up
|
||||
# worst case the splash page won't open
|
||||
}
|
||||
}
|
||||
|
||||
# still yolo
|
BIN
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/RestSharp.105.1.0.nupkg
vendored
Normal file
BIN
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/RestSharp.105.1.0.nupkg
vendored
Normal file
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net35/RestSharp.dll
vendored
Normal file
BIN
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net35/RestSharp.dll
vendored
Normal file
Binary file not shown.
2777
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net35/RestSharp.xml
vendored
Normal file
2777
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net35/RestSharp.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net4/RestSharp.dll
vendored
Normal file
BIN
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net4/RestSharp.dll
vendored
Normal file
Binary file not shown.
3014
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net4/RestSharp.xml
vendored
Normal file
3014
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net4/RestSharp.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net45/RestSharp.dll
vendored
Normal file
BIN
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net45/RestSharp.dll
vendored
Normal file
Binary file not shown.
3014
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net45/RestSharp.xml
vendored
Normal file
3014
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net45/RestSharp.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net451/RestSharp.dll
vendored
Normal file
BIN
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net451/RestSharp.dll
vendored
Normal file
Binary file not shown.
3014
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net451/RestSharp.xml
vendored
Normal file
3014
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net451/RestSharp.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net452/RestSharp.dll
vendored
Normal file
BIN
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net452/RestSharp.dll
vendored
Normal file
Binary file not shown.
3014
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net452/RestSharp.xml
vendored
Normal file
3014
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/lib/net452/RestSharp.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
22
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/readme.txt
vendored
Normal file
22
samples/client/petstore/csharp/SwaggerClientTest/packages/RestSharp.105.1.0/readme.txt
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
*** IMPORTANT CHANGE IN RESTSHARP VERSION 103 ***
|
||||
|
||||
In 103.0, JSON.NET was removed as a dependency.
|
||||
|
||||
If this is still installed in your project and no other libraries depend on
|
||||
it you may remove it from your installed packages.
|
||||
|
||||
There is one breaking change: the default Json*Serializer* is no longer
|
||||
compatible with Json.NET. To use Json.NET for serialization, copy the code
|
||||
from https://github.com/restsharp/RestSharp/blob/86b31f9adf049d7fb821de8279154f41a17b36f7/RestSharp/Serializers/JsonSerializer.cs
|
||||
and register it with your client:
|
||||
|
||||
var client = new RestClient();
|
||||
client.JsonSerializer = new YourCustomSerializer();
|
||||
|
||||
The default Json*Deserializer* is mostly compatible, but it does not support
|
||||
all features which Json.NET has (like the ability to support a custom [JsonConverter]
|
||||
by decorating a certain property with an attribute). If you need these features, you
|
||||
must take care of the deserialization yourself to get it working.
|
||||
|
||||
If you run into any compatibility issues with deserialization,
|
||||
please report it to http://groups.google.com/group/restsharp
|
Loading…
x
Reference in New Issue
Block a user