From 80d10e2cba4d2d06560777084fe8c6bccb4a84e3 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 19 Apr 2018 15:05:47 +0800 Subject: [PATCH] Update C# dotnet2 client with OAS2, OAS3 petstore (#143) * update csharp2 from codegen 2x * update csharp dotnet 2 client (oas2) * update csharp dotnet2 with pestore oas3 --- bin/csharp-dotnet2-petstore.sh | 2 +- bin/openapi3/csharp-dotnet2-petstore.sh | 31 ++++++++++ .../openapitools/codegen/DefaultCodegen.java | 2 + .../languages/CSharpDotNet2ClientCodegen.java | 1 + .../resources/csharp-dotnet2/api_doc.mustache | 7 ++- .../csharp-dotnet2/model_doc.mustache | 2 +- .../SwaggerClient/.swagger-codegen/VERSION | 2 +- .../Lib/SwaggerClient/README.md | 6 +- .../Lib/SwaggerClient/docs/Pet.md | 4 +- .../Lib/SwaggerClient/docs/PetApi.md | 38 +++++------- .../Lib/SwaggerClient/docs/StoreApi.md | 14 ++--- .../Lib/SwaggerClient/docs/UserApi.md | 62 ++++++++----------- .../CsharpDotNet2/IO/Swagger/Api/PetApi.cs | 28 ++++----- .../CsharpDotNet2/IO/Swagger/Api/StoreApi.cs | 14 ++--- .../CsharpDotNet2/IO/Swagger/Api/UserApi.cs | 60 +++++++++--------- 15 files changed, 145 insertions(+), 128 deletions(-) create mode 100755 bin/openapi3/csharp-dotnet2-petstore.sh diff --git a/bin/csharp-dotnet2-petstore.sh b/bin/csharp-dotnet2-petstore.sh index 8d24c48664b..2dde9b6a636 100755 --- a/bin/csharp-dotnet2-petstore.sh +++ b/bin/csharp-dotnet2-petstore.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l csharp-dotnet2 -o samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient --additional-properties hideGenerationTimestamp=true" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l csharp-dotnet2 -o samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient --additional-properties hideGenerationTimestamp=true $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/csharp-dotnet2-petstore.sh b/bin/openapi3/csharp-dotnet2-petstore.sh new file mode 100755 index 00000000000..eb4cdfbf50b --- /dev/null +++ b/bin/openapi3/csharp-dotnet2-petstore.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l csharp-dotnet2 -o samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient --additional-properties hideGenerationTimestamp=true $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index fa8cd65a8f9..aef49fd28e5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -1041,6 +1041,8 @@ public class DefaultCodegen implements CodegenConfig { codegenParameter.example = "3.4"; } else if (Boolean.TRUE.equals(codegenParameter.isDouble)) { codegenParameter.example = "1.2"; + } else if (Boolean.TRUE.equals(codegenParameter.isNumber)) { + codegenParameter.example = "8.14"; } else if (Boolean.TRUE.equals(codegenParameter.isBinary)) { codegenParameter.example = "BINARY_DATA_HERE"; } else if (Boolean.TRUE.equals(codegenParameter.isByteArray)) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpDotNet2ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpDotNet2ClientCodegen.java index 2c6673aafc9..422a045830f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpDotNet2ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpDotNet2ClientCodegen.java @@ -1,6 +1,7 @@ package org.openapitools.codegen.languages; import org.openapitools.codegen.*; + import java.io.File; public class CSharpDotNet2ClientCodegen extends AbstractCSharpCodegen { diff --git a/modules/openapi-generator/src/main/resources/csharp-dotnet2/api_doc.mustache b/modules/openapi-generator/src/main/resources/csharp-dotnet2/api_doc.mustache index d8a074e11f3..1a772761894 100644 --- a/modules/openapi-generator/src/main/resources/csharp-dotnet2/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-dotnet2/api_doc.mustache @@ -47,7 +47,12 @@ namespace Example var apiInstance = new {{classname}}(); {{#allParams}} {{#isPrimitiveType}} + {{^isBinary}} var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isBinary}} + {{#isBinary}} + var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isBinary}} {{/isPrimitiveType}} {{^isPrimitiveType}} var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} @@ -75,7 +80,7 @@ namespace Example {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isFile}}**{{{dataType}}}**{{/isFile}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{{dataType}}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{baseType}}.md){{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/csharp-dotnet2/model_doc.mustache b/modules/openapi-generator/src/main/resources/csharp-dotnet2/model_doc.mustache index e7c3ed75934..bd8622f7552 100644 --- a/modules/openapi-generator/src/main/resources/csharp-dotnet2/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-dotnet2/model_doc.mustache @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{{datatype}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{datatype}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.swagger-codegen/VERSION b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.swagger-codegen/VERSION index 855ff9501eb..096bf47efe3 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.swagger-codegen/VERSION +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md index a9d7285c925..b255c708f38 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/README.md @@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c - API version: 1.0.0 - SDK version: 1.0.0 -- Build package: io.swagger.codegen.languages.CsharpDotNet2ClientCodegen +- Build package: org.openapitools.codegen.languages.CSharpDotNet2ClientCodegen ## Frameworks supported @@ -53,12 +53,12 @@ namespace Example Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var body = new Pet(); // Pet | Pet object that needs to be added to the store + var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { // Add a new pet to the store - apiInstance.AddPet(body); + apiInstance.AddPet(pet); } catch (Exception e) { diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Pet.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Pet.md index e83933d1c60..e936d860327 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Pet.md +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/Pet.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes **Id** | **long?** | | [optional] **Category** | [**Category**](Category.md) | | [optional] **Name** | **string** | | -**PhotoUrls** | **List<string>** | | -**Tags** | [**List<Tag>**](Tag.md) | | [optional] +**PhotoUrls** | **List** | | +**Tags** | [**List**](Tag.md) | | [optional] **Status** | **string** | pet status in the store | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md index 1d6e816e39b..49c905df7cb 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **AddPet** -> void AddPet (Pet body) +> void AddPet (Pet pet) Add a new pet to the store - - ### Example ```csharp using System; @@ -41,12 +39,12 @@ namespace Example Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var body = new Pet(); // Pet | Pet object that needs to be added to the store + var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { // Add a new pet to the store - apiInstance.AddPet(body); + apiInstance.AddPet(pet); } catch (Exception e) { @@ -61,7 +59,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -73,8 +71,8 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -84,8 +82,6 @@ void (empty response body) Deletes a pet - - ### Example ```csharp using System; @@ -140,7 +136,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -343,12 +339,10 @@ Name | Type | Description | Notes # **UpdatePet** -> void UpdatePet (Pet body) +> void UpdatePet (Pet pet) Update an existing pet - - ### Example ```csharp using System; @@ -368,12 +362,12 @@ namespace Example Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var body = new Pet(); // Pet | Pet object that needs to be added to the store + var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { // Update an existing pet - apiInstance.UpdatePet(body); + apiInstance.UpdatePet(pet); } catch (Exception e) { @@ -388,7 +382,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -400,8 +394,8 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -411,8 +405,6 @@ void (empty response body) Updates a pet in the store with form data - - ### Example ```csharp using System; @@ -469,7 +461,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -479,8 +471,6 @@ void (empty response body) uploads an image - - ### Example ```csharp using System; diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/StoreApi.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/StoreApi.md index 24d03a779c5..e4a417df7f4 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/StoreApi.md +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/StoreApi.md @@ -67,7 +67,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -198,12 +198,10 @@ No authorization required # **PlaceOrder** -> Order PlaceOrder (Order body) +> Order PlaceOrder (Order order) Place an order for a pet - - ### Example ```csharp using System; @@ -220,12 +218,12 @@ namespace Example { var apiInstance = new StoreApi(); - var body = new Order(); // Order | order placed for purchasing the pet + var order = new Order(); // Order | order placed for purchasing the pet try { // Place an order for a pet - Order result = apiInstance.PlaceOrder(body); + Order result = apiInstance.PlaceOrder(order); Debug.WriteLine(result); } catch (Exception e) @@ -241,7 +239,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -253,7 +251,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/UserApi.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/UserApi.md index e016a7a5e30..f590fbe686c 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/UserApi.md +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **CreateUser** -> void CreateUser (User body) +> void CreateUser (User user) Create user @@ -38,12 +38,12 @@ namespace Example { var apiInstance = new UserApi(); - var body = new User(); // User | Created user object + var user = new User(); // User | Created user object try { // Create user - apiInstance.CreateUser(body); + apiInstance.CreateUser(user); } catch (Exception e) { @@ -58,7 +58,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -70,19 +70,17 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **CreateUsersWithArrayInput** -> void CreateUsersWithArrayInput (List body) +> void CreateUsersWithArrayInput (List user) Creates list of users with given input array - - ### Example ```csharp using System; @@ -99,12 +97,12 @@ namespace Example { var apiInstance = new UserApi(); - var body = new List(); // List | List of user object + var user = new List(); // List | List of user object try { // Creates list of users with given input array - apiInstance.CreateUsersWithArrayInput(body); + apiInstance.CreateUsersWithArrayInput(user); } catch (Exception e) { @@ -119,7 +117,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List**](User.md)| List of user object | + **user** | [**List**](List.md)| List of user object | ### Return type @@ -132,18 +130,16 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **CreateUsersWithListInput** -> void CreateUsersWithListInput (List body) +> void CreateUsersWithListInput (List user) Creates list of users with given input array - - ### Example ```csharp using System; @@ -160,12 +156,12 @@ namespace Example { var apiInstance = new UserApi(); - var body = new List(); // List | List of user object + var user = new List(); // List | List of user object try { // Creates list of users with given input array - apiInstance.CreateUsersWithListInput(body); + apiInstance.CreateUsersWithListInput(user); } catch (Exception e) { @@ -180,7 +176,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List**](User.md)| List of user object | + **user** | [**List**](List.md)| List of user object | ### Return type @@ -193,7 +189,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -254,7 +250,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -264,8 +260,6 @@ No authorization required Get user by user name - - ### Example ```csharp using System; @@ -282,7 +276,7 @@ namespace Example { var apiInstance = new UserApi(); - var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. + var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. try { @@ -303,7 +297,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **string**| The name that needs to be fetched. Use user1 for testing. | + **username** | **string**| The name that needs to be fetched. Use user1 for testing. | ### Return type @@ -326,8 +320,6 @@ No authorization required Logs user into the system - - ### Example ```csharp using System; @@ -390,8 +382,6 @@ No authorization required Logs out current logged in user session - - ### Example ```csharp using System; @@ -437,13 +427,13 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **UpdateUser** -> void UpdateUser (string username, User body) +> void UpdateUser (string username, User user) Updated user @@ -466,12 +456,12 @@ namespace Example var apiInstance = new UserApi(); var username = username_example; // string | name that need to be deleted - var body = new User(); // User | Updated user object + var user = new User(); // User | Updated user object try { // Updated user - apiInstance.UpdateUser(username, body); + apiInstance.UpdateUser(username, user); } catch (Exception e) { @@ -487,7 +477,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -499,8 +489,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/PetApi.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/PetApi.cs index 2a513818a31..b599ee547a7 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/PetApi.cs @@ -14,9 +14,9 @@ namespace IO.Swagger.Api /// /// Add a new pet to the store /// - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void AddPet (Pet body); + void AddPet (Pet pet); /// /// Deletes a pet /// @@ -45,9 +45,9 @@ namespace IO.Swagger.Api /// /// Update an existing pet /// - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void UpdatePet (Pet body); + void UpdatePet (Pet pet); /// /// Updates a pet in the store with form data /// @@ -122,13 +122,13 @@ namespace IO.Swagger.Api /// /// Add a new pet to the store /// - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - public void AddPet (Pet body) + public void AddPet (Pet pet) { - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling AddPet"); + // verify the required parameter 'pet' is set + if (pet == null) throw new ApiException(400, "Missing required parameter 'pet' when calling AddPet"); var path = "/pet"; @@ -140,7 +140,7 @@ namespace IO.Swagger.Api var fileParams = new Dictionary(); String postBody = null; - postBody = ApiClient.Serialize(body); // http body (model) parameter + postBody = ApiClient.Serialize(pet); // http body (model) parameter // authentication setting, if any String[] authSettings = new String[] { "petstore_auth" }; @@ -309,13 +309,13 @@ namespace IO.Swagger.Api /// /// Update an existing pet /// - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - public void UpdatePet (Pet body) + public void UpdatePet (Pet pet) { - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling UpdatePet"); + // verify the required parameter 'pet' is set + if (pet == null) throw new ApiException(400, "Missing required parameter 'pet' when calling UpdatePet"); var path = "/pet"; @@ -327,7 +327,7 @@ namespace IO.Swagger.Api var fileParams = new Dictionary(); String postBody = null; - postBody = ApiClient.Serialize(body); // http body (model) parameter + postBody = ApiClient.Serialize(pet); // http body (model) parameter // authentication setting, if any String[] authSettings = new String[] { "petstore_auth" }; diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/StoreApi.cs index beda97853b1..2dc42d1270e 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/StoreApi.cs @@ -31,9 +31,9 @@ namespace IO.Swagger.Api /// /// Place an order for a pet /// - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - Order PlaceOrder (Order body); + Order PlaceOrder (Order order); } /// @@ -198,13 +198,13 @@ namespace IO.Swagger.Api /// /// Place an order for a pet /// - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - public Order PlaceOrder (Order body) + public Order PlaceOrder (Order order) { - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling PlaceOrder"); + // verify the required parameter 'order' is set + if (order == null) throw new ApiException(400, "Missing required parameter 'order' when calling PlaceOrder"); var path = "/store/order"; @@ -216,7 +216,7 @@ namespace IO.Swagger.Api var fileParams = new Dictionary(); String postBody = null; - postBody = ApiClient.Serialize(body); // http body (model) parameter + postBody = ApiClient.Serialize(order); // http body (model) parameter // authentication setting, if any String[] authSettings = new String[] { }; diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/UserApi.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/UserApi.cs index e57bd2f8873..4e7b663751d 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/UserApi.cs +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/UserApi.cs @@ -14,21 +14,21 @@ namespace IO.Swagger.Api /// /// Create user This can only be done by the logged in user. /// - /// Created user object + /// Created user object /// - void CreateUser (User body); + void CreateUser (User user); /// /// Creates list of users with given input array /// - /// List of user object + /// List of user object /// - void CreateUsersWithArrayInput (List body); + void CreateUsersWithArrayInput (List user); /// /// Creates list of users with given input array /// - /// List of user object + /// List of user object /// - void CreateUsersWithListInput (List body); + void CreateUsersWithListInput (List user); /// /// Delete user This can only be done by the logged in user. /// @@ -38,7 +38,7 @@ namespace IO.Swagger.Api /// /// Get user by user name /// - /// The name that needs to be fetched. Use user1 for testing. + /// The name that needs to be fetched. Use user1 for testing. /// User User GetUserByName (string username); /// @@ -57,9 +57,9 @@ namespace IO.Swagger.Api /// Updated user This can only be done by the logged in user. /// /// name that need to be deleted - /// Updated user object + /// Updated user object /// - void UpdateUser (string username, User body); + void UpdateUser (string username, User user); } /// @@ -118,13 +118,13 @@ namespace IO.Swagger.Api /// /// Create user This can only be done by the logged in user. /// - /// Created user object + /// Created user object /// - public void CreateUser (User body) + public void CreateUser (User user) { - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling CreateUser"); + // verify the required parameter 'user' is set + if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUser"); var path = "/user"; @@ -136,7 +136,7 @@ namespace IO.Swagger.Api var fileParams = new Dictionary(); String postBody = null; - postBody = ApiClient.Serialize(body); // http body (model) parameter + postBody = ApiClient.Serialize(user); // http body (model) parameter // authentication setting, if any String[] authSettings = new String[] { }; @@ -155,13 +155,13 @@ namespace IO.Swagger.Api /// /// Creates list of users with given input array /// - /// List of user object + /// List of user object /// - public void CreateUsersWithArrayInput (List body) + public void CreateUsersWithArrayInput (List user) { - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling CreateUsersWithArrayInput"); + // verify the required parameter 'user' is set + if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUsersWithArrayInput"); var path = "/user/createWithArray"; @@ -173,7 +173,7 @@ namespace IO.Swagger.Api var fileParams = new Dictionary(); String postBody = null; - postBody = ApiClient.Serialize(body); // http body (model) parameter + postBody = ApiClient.Serialize(user); // http body (model) parameter // authentication setting, if any String[] authSettings = new String[] { }; @@ -192,13 +192,13 @@ namespace IO.Swagger.Api /// /// Creates list of users with given input array /// - /// List of user object + /// List of user object /// - public void CreateUsersWithListInput (List body) + public void CreateUsersWithListInput (List user) { - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling CreateUsersWithListInput"); + // verify the required parameter 'user' is set + if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUsersWithListInput"); var path = "/user/createWithList"; @@ -210,7 +210,7 @@ namespace IO.Swagger.Api var fileParams = new Dictionary(); String postBody = null; - postBody = ApiClient.Serialize(body); // http body (model) parameter + postBody = ApiClient.Serialize(user); // http body (model) parameter // authentication setting, if any String[] authSettings = new String[] { }; @@ -266,7 +266,7 @@ namespace IO.Swagger.Api /// /// Get user by user name /// - /// The name that needs to be fetched. Use user1 for testing. + /// The name that needs to be fetched. Use user1 for testing. /// User public User GetUserByName (string username) { @@ -378,16 +378,16 @@ namespace IO.Swagger.Api /// Updated user This can only be done by the logged in user. /// /// name that need to be deleted - /// Updated user object + /// Updated user object /// - public void UpdateUser (string username, User body) + public void UpdateUser (string username, User user) { // verify the required parameter 'username' is set if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser"); - // verify the required parameter 'body' is set - if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling UpdateUser"); + // verify the required parameter 'user' is set + if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling UpdateUser"); var path = "/user/{username}"; @@ -400,7 +400,7 @@ namespace IO.Swagger.Api var fileParams = new Dictionary(); String postBody = null; - postBody = ApiClient.Serialize(body); // http body (model) parameter + postBody = ApiClient.Serialize(user); // http body (model) parameter // authentication setting, if any String[] authSettings = new String[] { };