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
This commit is contained in:
William Cheng 2018-04-19 15:05:47 +08:00 committed by GitHub
parent 6e2ca294b5
commit 80d10e2cba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 145 additions and 128 deletions

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # 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" 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 java $JAVA_OPTS -jar $executable $ags

View File

@ -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

View File

@ -1041,6 +1041,8 @@ public class DefaultCodegen implements CodegenConfig {
codegenParameter.example = "3.4"; codegenParameter.example = "3.4";
} else if (Boolean.TRUE.equals(codegenParameter.isDouble)) { } else if (Boolean.TRUE.equals(codegenParameter.isDouble)) {
codegenParameter.example = "1.2"; codegenParameter.example = "1.2";
} else if (Boolean.TRUE.equals(codegenParameter.isNumber)) {
codegenParameter.example = "8.14";
} else if (Boolean.TRUE.equals(codegenParameter.isBinary)) { } else if (Boolean.TRUE.equals(codegenParameter.isBinary)) {
codegenParameter.example = "BINARY_DATA_HERE"; codegenParameter.example = "BINARY_DATA_HERE";
} else if (Boolean.TRUE.equals(codegenParameter.isByteArray)) { } else if (Boolean.TRUE.equals(codegenParameter.isByteArray)) {

View File

@ -1,6 +1,7 @@
package org.openapitools.codegen.languages; package org.openapitools.codegen.languages;
import org.openapitools.codegen.*; import org.openapitools.codegen.*;
import java.io.File; import java.io.File;
public class CSharpDotNet2ClientCodegen extends AbstractCSharpCodegen { public class CSharpDotNet2ClientCodegen extends AbstractCSharpCodegen {

View File

@ -47,7 +47,12 @@ namespace Example
var apiInstance = new {{classname}}(); var apiInstance = new {{classname}}();
{{#allParams}} {{#allParams}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
{{^isBinary}}
var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} 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}}
{{^isPrimitiveType}} {{^isPrimitiveType}}
var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} 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}} {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} ------------- | ------------- | ------------- | -------------{{/-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}} {{/allParams}}
### Return type ### Return type

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes 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}} {{/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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c
- API version: 1.0.0 - API version: 1.0.0
- SDK version: 1.0.0 - SDK version: 1.0.0
- Build package: io.swagger.codegen.languages.CsharpDotNet2ClientCodegen - Build package: org.openapitools.codegen.languages.CSharpDotNet2ClientCodegen
<a name="frameworks-supported"></a> <a name="frameworks-supported"></a>
## Frameworks supported ## Frameworks supported
@ -53,12 +53,12 @@ namespace Example
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(); 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 try
{ {
// Add a new pet to the store // Add a new pet to the store
apiInstance.AddPet(body); apiInstance.AddPet(pet);
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -6,8 +6,8 @@ Name | Type | Description | Notes
**Id** | **long?** | | [optional] **Id** | **long?** | | [optional]
**Category** | [**Category**](Category.md) | | [optional] **Category** | [**Category**](Category.md) | | [optional]
**Name** | **string** | | **Name** | **string** | |
**PhotoUrls** | **List&lt;string&gt;** | | **PhotoUrls** | **List<string>** | |
**Tags** | [**List&lt;Tag&gt;**](Tag.md) | | [optional] **Tags** | [**List<Tag>**](Tag.md) | | [optional]
**Status** | **string** | pet status in the store | [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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -16,12 +16,10 @@ Method | HTTP request | Description
<a name="addpet"></a> <a name="addpet"></a>
# **AddPet** # **AddPet**
> void AddPet (Pet body) > void AddPet (Pet pet)
Add a new pet to the store Add a new pet to the store
### Example ### Example
```csharp ```csharp
using System; using System;
@ -41,12 +39,12 @@ namespace Example
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(); 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 try
{ {
// Add a new pet to the store // Add a new pet to the store
apiInstance.AddPet(body); apiInstance.AddPet(pet);
} }
catch (Exception e) catch (Exception e)
{ {
@ -61,7 +59,7 @@ namespace Example
Name | Type | Description | Notes 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 ### Return type
@ -73,8 +71,8 @@ void (empty response body)
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/json, application/xml - **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) [[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 Deletes a pet
### Example ### Example
```csharp ```csharp
using System; using System;
@ -140,7 +136,7 @@ void (empty response body)
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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
<a name="updatepet"></a> <a name="updatepet"></a>
# **UpdatePet** # **UpdatePet**
> void UpdatePet (Pet body) > void UpdatePet (Pet pet)
Update an existing pet Update an existing pet
### Example ### Example
```csharp ```csharp
using System; using System;
@ -368,12 +362,12 @@ namespace Example
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(); 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 try
{ {
// Update an existing pet // Update an existing pet
apiInstance.UpdatePet(body); apiInstance.UpdatePet(pet);
} }
catch (Exception e) catch (Exception e)
{ {
@ -388,7 +382,7 @@ namespace Example
Name | Type | Description | Notes 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 ### Return type
@ -400,8 +394,8 @@ void (empty response body)
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/json, application/xml - **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) [[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 Updates a pet in the store with form data
### Example ### Example
```csharp ```csharp
using System; using System;
@ -469,7 +461,7 @@ void (empty response body)
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded - **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) [[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 uploads an image
### Example ### Example
```csharp ```csharp
using System; using System;

View File

@ -67,7 +67,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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
<a name="placeorder"></a> <a name="placeorder"></a>
# **PlaceOrder** # **PlaceOrder**
> Order PlaceOrder (Order body) > Order PlaceOrder (Order order)
Place an order for a pet Place an order for a pet
### Example ### Example
```csharp ```csharp
using System; using System;
@ -220,12 +218,12 @@ namespace Example
{ {
var apiInstance = new StoreApi(); 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 try
{ {
// Place an order for a pet // Place an order for a pet
Order result = apiInstance.PlaceOrder(body); Order result = apiInstance.PlaceOrder(order);
Debug.WriteLine(result); Debug.WriteLine(result);
} }
catch (Exception e) catch (Exception e)
@ -241,7 +239,7 @@ namespace Example
Name | Type | Description | Notes 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 ### Return type
@ -253,7 +251,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **Accept**: application/xml, 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) [[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)

View File

@ -16,7 +16,7 @@ Method | HTTP request | Description
<a name="createuser"></a> <a name="createuser"></a>
# **CreateUser** # **CreateUser**
> void CreateUser (User body) > void CreateUser (User user)
Create user Create user
@ -38,12 +38,12 @@ namespace Example
{ {
var apiInstance = new UserApi(); var apiInstance = new UserApi();
var body = new User(); // User | Created user object var user = new User(); // User | Created user object
try try
{ {
// Create user // Create user
apiInstance.CreateUser(body); apiInstance.CreateUser(user);
} }
catch (Exception e) catch (Exception e)
{ {
@ -58,7 +58,7 @@ namespace Example
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**User**](User.md)| Created user object | **user** | [**User**](User.md)| Created user object |
### Return type ### Return type
@ -70,19 +70,17 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **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) [[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)
<a name="createuserswitharrayinput"></a> <a name="createuserswitharrayinput"></a>
# **CreateUsersWithArrayInput** # **CreateUsersWithArrayInput**
> void CreateUsersWithArrayInput (List<User> body) > void CreateUsersWithArrayInput (List<User> user)
Creates list of users with given input array Creates list of users with given input array
### Example ### Example
```csharp ```csharp
using System; using System;
@ -99,12 +97,12 @@ namespace Example
{ {
var apiInstance = new UserApi(); var apiInstance = new UserApi();
var body = new List<User>(); // List<User> | List of user object var user = new List<User>(); // List<User> | List of user object
try try
{ {
// Creates list of users with given input array // Creates list of users with given input array
apiInstance.CreateUsersWithArrayInput(body); apiInstance.CreateUsersWithArrayInput(user);
} }
catch (Exception e) catch (Exception e)
{ {
@ -119,7 +117,7 @@ namespace Example
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**List<User>**](User.md)| List of user object | **user** | [**List<User>**](List.md)| List of user object |
### Return type ### Return type
@ -132,18 +130,16 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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)
<a name="createuserswithlistinput"></a> <a name="createuserswithlistinput"></a>
# **CreateUsersWithListInput** # **CreateUsersWithListInput**
> void CreateUsersWithListInput (List<User> body) > void CreateUsersWithListInput (List<User> user)
Creates list of users with given input array Creates list of users with given input array
### Example ### Example
```csharp ```csharp
using System; using System;
@ -160,12 +156,12 @@ namespace Example
{ {
var apiInstance = new UserApi(); var apiInstance = new UserApi();
var body = new List<User>(); // List<User> | List of user object var user = new List<User>(); // List<User> | List of user object
try try
{ {
// Creates list of users with given input array // Creates list of users with given input array
apiInstance.CreateUsersWithListInput(body); apiInstance.CreateUsersWithListInput(user);
} }
catch (Exception e) catch (Exception e)
{ {
@ -180,7 +176,7 @@ namespace Example
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**List<User>**](User.md)| List of user object | **user** | [**List<User>**](List.md)| List of user object |
### Return type ### Return type
@ -193,7 +189,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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 ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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 Get user by user name
### Example ### Example
```csharp ```csharp
using System; using System;
@ -303,7 +297,7 @@ namespace Example
Name | Type | Description | Notes 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 ### Return type
@ -326,8 +320,6 @@ No authorization required
Logs user into the system Logs user into the system
### Example ### Example
```csharp ```csharp
using System; using System;
@ -390,8 +382,6 @@ No authorization required
Logs out current logged in user session Logs out current logged in user session
### Example ### Example
```csharp ```csharp
using System; using System;
@ -437,13 +427,13 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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)
<a name="updateuser"></a> <a name="updateuser"></a>
# **UpdateUser** # **UpdateUser**
> void UpdateUser (string username, User body) > void UpdateUser (string username, User user)
Updated user Updated user
@ -466,12 +456,12 @@ namespace Example
var apiInstance = new UserApi(); var apiInstance = new UserApi();
var username = username_example; // string | name that need to be deleted 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 try
{ {
// Updated user // Updated user
apiInstance.UpdateUser(username, body); apiInstance.UpdateUser(username, user);
} }
catch (Exception e) catch (Exception e)
{ {
@ -487,7 +477,7 @@ namespace Example
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**username** | **string**| name that need to be deleted | **username** | **string**| name that need to be deleted |
**body** | [**User**](User.md)| Updated user object | **user** | [**User**](User.md)| Updated user object |
### Return type ### Return type
@ -499,8 +489,8 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: application/json
- **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) [[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)

View File

@ -14,9 +14,9 @@ namespace IO.Swagger.Api
/// <summary> /// <summary>
/// Add a new pet to the store /// Add a new pet to the store
/// </summary> /// </summary>
/// <param name="body">Pet object that needs to be added to the store</param> /// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns></returns> /// <returns></returns>
void AddPet (Pet body); void AddPet (Pet pet);
/// <summary> /// <summary>
/// Deletes a pet /// Deletes a pet
/// </summary> /// </summary>
@ -45,9 +45,9 @@ namespace IO.Swagger.Api
/// <summary> /// <summary>
/// Update an existing pet /// Update an existing pet
/// </summary> /// </summary>
/// <param name="body">Pet object that needs to be added to the store</param> /// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns></returns> /// <returns></returns>
void UpdatePet (Pet body); void UpdatePet (Pet pet);
/// <summary> /// <summary>
/// Updates a pet in the store with form data /// Updates a pet in the store with form data
/// </summary> /// </summary>
@ -122,13 +122,13 @@ namespace IO.Swagger.Api
/// <summary> /// <summary>
/// Add a new pet to the store /// Add a new pet to the store
/// </summary> /// </summary>
/// <param name="body">Pet object that needs to be added to the store</param> /// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns></returns> /// <returns></returns>
public void AddPet (Pet body) public void AddPet (Pet pet)
{ {
// verify the required parameter 'body' is set // verify the required parameter 'pet' is set
if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling AddPet"); if (pet == null) throw new ApiException(400, "Missing required parameter 'pet' when calling AddPet");
var path = "/pet"; var path = "/pet";
@ -140,7 +140,7 @@ namespace IO.Swagger.Api
var fileParams = new Dictionary<String, FileParameter>(); var fileParams = new Dictionary<String, FileParameter>();
String postBody = null; String postBody = null;
postBody = ApiClient.Serialize(body); // http body (model) parameter postBody = ApiClient.Serialize(pet); // http body (model) parameter
// authentication setting, if any // authentication setting, if any
String[] authSettings = new String[] { "petstore_auth" }; String[] authSettings = new String[] { "petstore_auth" };
@ -309,13 +309,13 @@ namespace IO.Swagger.Api
/// <summary> /// <summary>
/// Update an existing pet /// Update an existing pet
/// </summary> /// </summary>
/// <param name="body">Pet object that needs to be added to the store</param> /// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns></returns> /// <returns></returns>
public void UpdatePet (Pet body) public void UpdatePet (Pet pet)
{ {
// verify the required parameter 'body' is set // verify the required parameter 'pet' is set
if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling UpdatePet"); if (pet == null) throw new ApiException(400, "Missing required parameter 'pet' when calling UpdatePet");
var path = "/pet"; var path = "/pet";
@ -327,7 +327,7 @@ namespace IO.Swagger.Api
var fileParams = new Dictionary<String, FileParameter>(); var fileParams = new Dictionary<String, FileParameter>();
String postBody = null; String postBody = null;
postBody = ApiClient.Serialize(body); // http body (model) parameter postBody = ApiClient.Serialize(pet); // http body (model) parameter
// authentication setting, if any // authentication setting, if any
String[] authSettings = new String[] { "petstore_auth" }; String[] authSettings = new String[] { "petstore_auth" };

View File

@ -31,9 +31,9 @@ namespace IO.Swagger.Api
/// <summary> /// <summary>
/// Place an order for a pet /// Place an order for a pet
/// </summary> /// </summary>
/// <param name="body">order placed for purchasing the pet</param> /// <param name="order">order placed for purchasing the pet</param>
/// <returns>Order</returns> /// <returns>Order</returns>
Order PlaceOrder (Order body); Order PlaceOrder (Order order);
} }
/// <summary> /// <summary>
@ -198,13 +198,13 @@ namespace IO.Swagger.Api
/// <summary> /// <summary>
/// Place an order for a pet /// Place an order for a pet
/// </summary> /// </summary>
/// <param name="body">order placed for purchasing the pet</param> /// <param name="order">order placed for purchasing the pet</param>
/// <returns>Order</returns> /// <returns>Order</returns>
public Order PlaceOrder (Order body) public Order PlaceOrder (Order order)
{ {
// verify the required parameter 'body' is set // verify the required parameter 'order' is set
if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling PlaceOrder"); if (order == null) throw new ApiException(400, "Missing required parameter 'order' when calling PlaceOrder");
var path = "/store/order"; var path = "/store/order";
@ -216,7 +216,7 @@ namespace IO.Swagger.Api
var fileParams = new Dictionary<String, FileParameter>(); var fileParams = new Dictionary<String, FileParameter>();
String postBody = null; String postBody = null;
postBody = ApiClient.Serialize(body); // http body (model) parameter postBody = ApiClient.Serialize(order); // http body (model) parameter
// authentication setting, if any // authentication setting, if any
String[] authSettings = new String[] { }; String[] authSettings = new String[] { };

View File

@ -14,21 +14,21 @@ namespace IO.Swagger.Api
/// <summary> /// <summary>
/// Create user This can only be done by the logged in user. /// Create user This can only be done by the logged in user.
/// </summary> /// </summary>
/// <param name="body">Created user object</param> /// <param name="user">Created user object</param>
/// <returns></returns> /// <returns></returns>
void CreateUser (User body); void CreateUser (User user);
/// <summary> /// <summary>
/// Creates list of users with given input array /// Creates list of users with given input array
/// </summary> /// </summary>
/// <param name="body">List of user object</param> /// <param name="user">List of user object</param>
/// <returns></returns> /// <returns></returns>
void CreateUsersWithArrayInput (List<User> body); void CreateUsersWithArrayInput (List<User> user);
/// <summary> /// <summary>
/// Creates list of users with given input array /// Creates list of users with given input array
/// </summary> /// </summary>
/// <param name="body">List of user object</param> /// <param name="user">List of user object</param>
/// <returns></returns> /// <returns></returns>
void CreateUsersWithListInput (List<User> body); void CreateUsersWithListInput (List<User> user);
/// <summary> /// <summary>
/// Delete user This can only be done by the logged in user. /// Delete user This can only be done by the logged in user.
/// </summary> /// </summary>
@ -38,7 +38,7 @@ namespace IO.Swagger.Api
/// <summary> /// <summary>
/// Get user by user name /// Get user by user name
/// </summary> /// </summary>
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param> /// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
/// <returns>User</returns> /// <returns>User</returns>
User GetUserByName (string username); User GetUserByName (string username);
/// <summary> /// <summary>
@ -57,9 +57,9 @@ namespace IO.Swagger.Api
/// Updated user This can only be done by the logged in user. /// Updated user This can only be done by the logged in user.
/// </summary> /// </summary>
/// <param name="username">name that need to be deleted</param> /// <param name="username">name that need to be deleted</param>
/// <param name="body">Updated user object</param> /// <param name="user">Updated user object</param>
/// <returns></returns> /// <returns></returns>
void UpdateUser (string username, User body); void UpdateUser (string username, User user);
} }
/// <summary> /// <summary>
@ -118,13 +118,13 @@ namespace IO.Swagger.Api
/// <summary> /// <summary>
/// Create user This can only be done by the logged in user. /// Create user This can only be done by the logged in user.
/// </summary> /// </summary>
/// <param name="body">Created user object</param> /// <param name="user">Created user object</param>
/// <returns></returns> /// <returns></returns>
public void CreateUser (User body) public void CreateUser (User user)
{ {
// verify the required parameter 'body' is set // verify the required parameter 'user' is set
if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling CreateUser"); if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUser");
var path = "/user"; var path = "/user";
@ -136,7 +136,7 @@ namespace IO.Swagger.Api
var fileParams = new Dictionary<String, FileParameter>(); var fileParams = new Dictionary<String, FileParameter>();
String postBody = null; String postBody = null;
postBody = ApiClient.Serialize(body); // http body (model) parameter postBody = ApiClient.Serialize(user); // http body (model) parameter
// authentication setting, if any // authentication setting, if any
String[] authSettings = new String[] { }; String[] authSettings = new String[] { };
@ -155,13 +155,13 @@ namespace IO.Swagger.Api
/// <summary> /// <summary>
/// Creates list of users with given input array /// Creates list of users with given input array
/// </summary> /// </summary>
/// <param name="body">List of user object</param> /// <param name="user">List of user object</param>
/// <returns></returns> /// <returns></returns>
public void CreateUsersWithArrayInput (List<User> body) public void CreateUsersWithArrayInput (List<User> user)
{ {
// verify the required parameter 'body' is set // verify the required parameter 'user' is set
if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling CreateUsersWithArrayInput"); if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUsersWithArrayInput");
var path = "/user/createWithArray"; var path = "/user/createWithArray";
@ -173,7 +173,7 @@ namespace IO.Swagger.Api
var fileParams = new Dictionary<String, FileParameter>(); var fileParams = new Dictionary<String, FileParameter>();
String postBody = null; String postBody = null;
postBody = ApiClient.Serialize(body); // http body (model) parameter postBody = ApiClient.Serialize(user); // http body (model) parameter
// authentication setting, if any // authentication setting, if any
String[] authSettings = new String[] { }; String[] authSettings = new String[] { };
@ -192,13 +192,13 @@ namespace IO.Swagger.Api
/// <summary> /// <summary>
/// Creates list of users with given input array /// Creates list of users with given input array
/// </summary> /// </summary>
/// <param name="body">List of user object</param> /// <param name="user">List of user object</param>
/// <returns></returns> /// <returns></returns>
public void CreateUsersWithListInput (List<User> body) public void CreateUsersWithListInput (List<User> user)
{ {
// verify the required parameter 'body' is set // verify the required parameter 'user' is set
if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling CreateUsersWithListInput"); if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling CreateUsersWithListInput");
var path = "/user/createWithList"; var path = "/user/createWithList";
@ -210,7 +210,7 @@ namespace IO.Swagger.Api
var fileParams = new Dictionary<String, FileParameter>(); var fileParams = new Dictionary<String, FileParameter>();
String postBody = null; String postBody = null;
postBody = ApiClient.Serialize(body); // http body (model) parameter postBody = ApiClient.Serialize(user); // http body (model) parameter
// authentication setting, if any // authentication setting, if any
String[] authSettings = new String[] { }; String[] authSettings = new String[] { };
@ -266,7 +266,7 @@ namespace IO.Swagger.Api
/// <summary> /// <summary>
/// Get user by user name /// Get user by user name
/// </summary> /// </summary>
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param> /// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
/// <returns>User</returns> /// <returns>User</returns>
public User GetUserByName (string username) 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. /// Updated user This can only be done by the logged in user.
/// </summary> /// </summary>
/// <param name="username">name that need to be deleted</param> /// <param name="username">name that need to be deleted</param>
/// <param name="body">Updated user object</param> /// <param name="user">Updated user object</param>
/// <returns></returns> /// <returns></returns>
public void UpdateUser (string username, User body) public void UpdateUser (string username, User user)
{ {
// verify the required parameter 'username' is set // verify the required parameter 'username' is set
if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser"); if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser");
// verify the required parameter 'body' is set // verify the required parameter 'user' is set
if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling UpdateUser"); if (user == null) throw new ApiException(400, "Missing required parameter 'user' when calling UpdateUser");
var path = "/user/{username}"; var path = "/user/{username}";
@ -400,7 +400,7 @@ namespace IO.Swagger.Api
var fileParams = new Dictionary<String, FileParameter>(); var fileParams = new Dictionary<String, FileParameter>();
String postBody = null; String postBody = null;
postBody = ApiClient.Serialize(body); // http body (model) parameter postBody = ApiClient.Serialize(user); // http body (model) parameter
// authentication setting, if any // authentication setting, if any
String[] authSettings = new String[] { }; String[] authSettings = new String[] { };