diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java index 1a288e7c2eae..2d34ae6b1dc2 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java @@ -67,12 +67,13 @@ public AbstractCSharpCodegen() { Arrays.asList("IDictionary") ); - setReservedWordsLowerCase( + // NOTE: C# uses camel cased reserved words, while models are title cased. We don't want lowercase comparisons. + reservedWords.addAll( Arrays.asList( // set "client" as a reserved word to avoid conflicts with IO.Swagger.Client // this is a workaround and can be removed if c# api client is updated to use // fully qualified name - "client", "parameter", + "Client", "client", "parameter", // local variable names in API methods (endpoints) "localVarPath", "localVarPathParams", "localVarQueryParams", "localVarHeaderParams", "localVarFormParams", "localVarFileParams", "localVarStatusCode", "localVarResponse", @@ -718,6 +719,12 @@ public String toDefaultValue(Property p) { return null; } + @Override + protected boolean isReservedWord(String word) { + // NOTE: This differs from super's implementation in that C# does _not_ want case insensitive matching. + return reservedWords.contains(word); + } + @Override public String getSwaggerType(Property p) { String swaggerType = super.getSwaggerType(p); @@ -727,6 +734,8 @@ public String getSwaggerType(Property p) { swaggerType = ""; // set swagger type to empty string if null } + // NOTE: typeMapping here supports things like string/String, long/Long, datetime/DateTime as lowercase keys. + // Should we require explicit casing here (values are not insensitive). // TODO avoid using toLowerCase as typeMapping should be case-sensitive if (typeMapping.containsKey(swaggerType.toLowerCase())) { type = typeMapping.get(swaggerType.toLowerCase()); @@ -739,16 +748,39 @@ public String getSwaggerType(Property p) { return toModelName(type); } + /** + * Provides C# strongly typed declaration for simple arrays of some type and arrays of arrays of some type. + * @param arr + * @return + */ + private String getArrayTypeDeclaration(ArrayProperty arr) { + // TODO: collection type here should be fully qualified namespace to avoid model conflicts + // This supports arrays of arrays. + String arrayType = typeMapping.get("array"); + StringBuilder instantiationType = new StringBuilder(arrayType); + Property items = arr.getItems(); + String nestedType = getTypeDeclaration(items); + // TODO: We may want to differentiate here between generics and primitive arrays. + instantiationType.append("<").append(nestedType).append(">"); + return instantiationType.toString(); + } + + @Override + public String toInstantiationType(Property p) { + if (p instanceof ArrayProperty) { + return getArrayTypeDeclaration((ArrayProperty) p); + } + return super.toInstantiationType(p); + } + @Override public String getTypeDeclaration(Property p) { if (p instanceof ArrayProperty) { - ArrayProperty ap = (ArrayProperty) p; - Property inner = ap.getItems(); - return getSwaggerType(p) + "<" + getTypeDeclaration(inner) + ">"; + return getArrayTypeDeclaration((ArrayProperty) p); } else if (p instanceof MapProperty) { + // Should we also support maps of maps? MapProperty mp = (MapProperty) p; Property inner = mp.getAdditionalProperties(); - return getSwaggerType(p) + ""; } return super.getTypeDeclaration(p); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AspNetCoreServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AspNetCoreServerCodegen.java index 22de7a1e6f3c..f5f05bf456ab 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AspNetCoreServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AspNetCoreServerCodegen.java @@ -35,7 +35,8 @@ public AspNetCoreServerCodegen() { apiTemplateFiles.put("controller.mustache", ".cs"); // contextually reserved words - setReservedWordsLowerCase( + // NOTE: C# uses camel cased reserved words, while models are title cased. We don't want lowercase comparisons. + reservedWords.addAll( Arrays.asList("var", "async", "await", "dynamic", "yield") ); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java index ab42bbaf80c4..b4b9c0c4d489 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java @@ -4,6 +4,8 @@ import com.samskivert.mustache.Mustache; import io.swagger.codegen.*; import io.swagger.models.Model; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.Property; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/csharp/CSharpModelTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/csharp/CSharpModelTest.java index 6e5c2076f5db..4d87e7d12b79 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/csharp/CSharpModelTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/csharp/CSharpModelTest.java @@ -9,18 +9,15 @@ import io.swagger.models.ModelImpl; import io.swagger.models.Path; import io.swagger.models.Swagger; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.DateTimeProperty; -import io.swagger.models.properties.LongProperty; -import io.swagger.models.properties.MapProperty; -import io.swagger.models.properties.RefProperty; -import io.swagger.models.properties.StringProperty; +import io.swagger.models.properties.*; import io.swagger.parser.SwaggerParser; import com.google.common.collect.Sets; import org.testng.Assert; import org.testng.annotations.Test; +import java.util.Arrays; +import java.util.HashMap; import java.util.Map; @SuppressWarnings("static-method") @@ -331,4 +328,51 @@ public void mapModelTest() { Assert.assertEquals(cm.imports.size(), 1); Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1); } + + @Test(description = "convert an array of array models") + public void arraysOfArraysModelTest() { + final Model model = new ArrayModel() + .description("a sample geolocation model") + .items( + new ArrayProperty().items(new DoubleProperty()) + ); + + final DefaultCodegen codegen = new CSharpClientCodegen(); + final CodegenModel cm = codegen.fromModel("sample", model); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.parent, "List>"); + } + + @Test(description = "convert an array of array properties") + public void arraysOfArraysPropertyTest() { + final Model model = new ModelImpl() + .description("a sample geolocation model") + .property("points", new ArrayProperty() + .items( + new ArrayProperty().items(new DoubleProperty()) + ) + ); + + final DefaultCodegen codegen = new CSharpClientCodegen(); + final CodegenModel cm = codegen.fromModel("sample", model); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertNull(cm.parent); + + Assert.assertEquals(cm.vars.size(), 1); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "points"); + Assert.assertNull(property1.complexType); + Assert.assertEquals(property1.datatype, "List>"); + Assert.assertEquals(property1.name, "Points"); + Assert.assertEquals(property1.baseType, "List"); + Assert.assertEquals(property1.containerType, "array"); + Assert.assertFalse(property1.required); + Assert.assertTrue(property1.isContainer); + Assert.assertFalse(property1.isNotContainer); + } } diff --git a/samples/client/petstore-security-test/csharp/SwaggerClient/README.md b/samples/client/petstore-security-test/csharp/SwaggerClient/README.md index d8ed7f1c12d0..4bc77a18568f 100644 --- a/samples/client/petstore-security-test/csharp/SwaggerClient/README.md +++ b/samples/client/petstore-security-test/csharp/SwaggerClient/README.md @@ -101,7 +101,7 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [Model.ModelReturn](docs/ModelReturn.md) + - [Model.Return](docs/Return.md) diff --git a/samples/client/petstore-security-test/csharp/SwaggerClient/docs/Return.md b/samples/client/petstore-security-test/csharp/SwaggerClient/docs/Return.md new file mode 100644 index 000000000000..af0d4ce739f6 --- /dev/null +++ b/samples/client/petstore-security-test/csharp/SwaggerClient/docs/Return.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.Return +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int?** | property description *_/ ' \" =end - - \\r\\n \\n \\r | [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-security-test/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ReturnTests.cs b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ReturnTests.cs new file mode 100644 index 000000000000..e9532e2f5b2b --- /dev/null +++ b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ReturnTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore *_/ ' \" =end - - \\r\\n \\n \\r + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end - - + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end - - \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end - - \\r\\n \\n \\r + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Return + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ReturnTests + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Return + /// + [Test] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Return + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Return"); + } + + + /// + /// Test the property '_Return' + /// + [Test] + public void _ReturnTest() + { + // TODO unit test for the property '_Return' + } + + } + +} diff --git a/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs index fa50c6bd07ee..04828623861e 100644 --- a/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs @@ -83,7 +83,7 @@ public partial class FakeApi : IFakeApi /// public FakeApi(String basePath) { - this.Configuration = new Configuration { BasePath = basePath }; + this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; } @@ -94,10 +94,10 @@ public FakeApi(String basePath) /// /// An instance of Configuration /// - public FakeApi(Configuration configuration = null) + public FakeApi(IO.Swagger.Client.Configuration configuration = null) { if (configuration == null) // use the default one in Configuration - this.Configuration = Configuration.Default; + this.Configuration = IO.Swagger.Client.Configuration.Default; else this.Configuration = configuration; @@ -127,7 +127,7 @@ public void SetBasePath(String basePath) /// Gets or sets the configuration object /// /// An instance of the Configuration - public Configuration Configuration {get; set;} + public IO.Swagger.Client.Configuration Configuration {get; set;} /// /// Provides a factory method hook for the creation of exceptions. @@ -190,7 +190,7 @@ public ApiResponse TestCodeInjectEndRnNRWithHttpInfo (string testCodeInj var localVarPath = "/fake"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); Object localVarPostBody = null; @@ -200,22 +200,22 @@ public ApiResponse TestCodeInjectEndRnNRWithHttpInfo (string testCodeInj "application/json", "*_/ ' =end - - " }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json", "*_/ ' =end - - " }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (testCodeInjectEndRnNR != null) localVarFormParams.Add("test code inject */ ' " =end -- \r\n \n \r", Configuration.ApiClient.ParameterToString(testCodeInjectEndRnNR)); // form parameter + if (testCodeInjectEndRnNR != null) localVarFormParams.Add("test code inject */ ' " =end -- \r\n \n \r", this.Configuration.ApiClient.ParameterToString(testCodeInjectEndRnNR)); // form parameter // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); @@ -256,7 +256,7 @@ public async System.Threading.Tasks.Task> TestCodeInjectEndR var localVarPath = "/fake"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); Object localVarPostBody = null; @@ -266,22 +266,22 @@ public async System.Threading.Tasks.Task> TestCodeInjectEndR "application/json", "*_/ ' =end - - " }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json", "*_/ ' =end - - " }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (testCodeInjectEndRnNR != null) localVarFormParams.Add("test code inject */ ' " =end -- \r\n \n \r", Configuration.ApiClient.ParameterToString(testCodeInjectEndRnNR)); // form parameter + if (testCodeInjectEndRnNR != null) localVarFormParams.Add("test code inject */ ' " =end -- \r\n \n \r", this.Configuration.ApiClient.ParameterToString(testCodeInjectEndRnNR)); // form parameter // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); diff --git a/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs new file mode 100644 index 000000000000..7867fe5cda5f --- /dev/null +++ b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs @@ -0,0 +1,125 @@ +/* + * Swagger Petstore *_/ ' \" =end - - \\r\\n \\n \\r + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end - - + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end - - \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end - - \\r\\n \\n \\r + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing reserved words *_/ ' \" =end - - \\r\\n \\n \\r + /// + [DataContract] + public partial class Return : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// property description *_/ ' \" =end - - \\r\\n \\n \\r. + public Return(int? _Return = default(int?)) + { + this._Return = _Return; + } + + /// + /// property description *_/ ' \" =end - - \\r\\n \\n \\r + /// + /// property description *_/ ' \" =end - - \\r\\n \\n \\r + [DataMember(Name="return", EmitDefaultValue=false)] + public int? _Return { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Return {\n"); + sb.Append(" _Return: ").Append(_Return).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Return); + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + if (input == null) + return false; + + return + ( + this._Return == input._Return || + (this._Return != null && + this._Return.Equals(input._Return)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Return != null) + hashCode = hashCode * 59 + this._Return.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/README.md b/samples/client/petstore/csharp/SwaggerClient/README.md index 7b5b59a8dcbb..8e64bcaf148b 100644 --- a/samples/client/petstore/csharp/SwaggerClient/README.md +++ b/samples/client/petstore/csharp/SwaggerClient/README.md @@ -152,7 +152,6 @@ Class | Method | HTTP request | Description - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) - - [Model.ModelReturn](docs/ModelReturn.md) - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) - [Model.Order](docs/Order.md) @@ -163,6 +162,7 @@ Class | Method | HTTP request | Description - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/ClassModel.md b/samples/client/petstore/csharp/SwaggerClient/docs/ClassModel.md index 760130f053cf..9bfd15db501d 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/ClassModel.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/ClassModel.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Class** | **string** | | [optional] +**Class** | **string** | | [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/SwaggerClient/docs/FormatTest.md b/samples/client/petstore/csharp/SwaggerClient/docs/FormatTest.md index 1d366bd7cab4..1108a1af428b 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/FormatTest.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/FormatTest.md @@ -7,10 +7,10 @@ Name | Type | Description | Notes **Int32** | **int?** | | [optional] **Int64** | **long?** | | [optional] **Number** | **decimal?** | | -**_Float** | **float?** | | [optional] -**_Double** | **double?** | | [optional] -**_String** | **string** | | [optional] -**_Byte** | **byte[]** | | +**Float** | **float?** | | [optional] +**Double** | **double?** | | [optional] +**String** | **string** | | [optional] +**Byte** | **byte[]** | | **Binary** | **byte[]** | | [optional] **Date** | **DateTime?** | | **DateTime** | **DateTime?** | | [optional] diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/Model200Response.md b/samples/client/petstore/csharp/SwaggerClient/docs/Model200Response.md index cfaddb67027e..62db21288f2b 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/Model200Response.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/Model200Response.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **int?** | | [optional] -**_Class** | **string** | | [optional] +**Class** | **string** | | [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/SwaggerClient/docs/ModelClient.md b/samples/client/petstore/csharp/SwaggerClient/docs/ModelClient.md index 9ecdc0e11410..c3817230640d 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/ModelClient.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/ModelClient.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Client** | **string** | | [optional] +**__Client** | **string** | | [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/SwaggerClient/docs/Return.md b/samples/client/petstore/csharp/SwaggerClient/docs/Return.md new file mode 100644 index 000000000000..9a9559907c14 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/docs/Return.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.Return +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int?** | | [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/SwaggerClient/src/IO.Swagger.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ReturnTests.cs new file mode 100644 index 000000000000..ec2a68a5fbb5 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/ReturnTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Return + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ReturnTests + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Return + /// + [Test] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Return + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Return"); + } + + + /// + /// Test the property '_Return' + /// + [Test] + public void _ReturnTest() + { + // TODO unit test for the property '_Return' + } + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ClassModel.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ClassModel.cs index cccdd843f007..cd82cd31dece 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ClassModel.cs @@ -33,17 +33,17 @@ public partial class ClassModel : IEquatable, IValidatableObject /// /// Initializes a new instance of the class. /// - /// _Class. - public ClassModel(string _Class = default(string)) + /// Class. + public ClassModel(string Class = default(string)) { - this._Class = _Class; + this.Class = Class; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="_class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -53,7 +53,7 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class ClassModel {\n"); - sb.Append(" _Class: ").Append(_Class).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -89,9 +89,9 @@ public bool Equals(ClassModel input) return ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -104,8 +104,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/FormatTest.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/FormatTest.cs index 25e6c7925f30..4a0c3f973834 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/FormatTest.cs @@ -42,16 +42,16 @@ public partial class FormatTest : IEquatable, IValidatableObject /// Int32. /// Int64. /// Number (required). - /// _Float. - /// _Double. - /// _String. - /// _Byte (required). + /// Float. + /// Double. + /// String. + /// Byte (required). /// Binary. /// Date (required). /// DateTime. /// Uuid. /// Password (required). - public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long? Int64 = default(long?), decimal? Number = default(decimal?), float? _Float = default(float?), double? _Double = default(double?), string _String = default(string), byte[] _Byte = default(byte[]), byte[] Binary = default(byte[]), DateTime? Date = default(DateTime?), DateTime? DateTime = default(DateTime?), Guid? Uuid = default(Guid?), string Password = default(string)) + public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long? Int64 = default(long?), decimal? Number = default(decimal?), float? Float = default(float?), double? Double = default(double?), string String = default(string), byte[] Byte = default(byte[]), byte[] Binary = default(byte[]), DateTime? Date = default(DateTime?), DateTime? DateTime = default(DateTime?), Guid? Uuid = default(Guid?), string Password = default(string)) { // to ensure "Number" is required (not null) if (Number == null) @@ -62,14 +62,14 @@ public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long { this.Number = Number; } - // to ensure "_Byte" is required (not null) - if (_Byte == null) + // to ensure "Byte" is required (not null) + if (Byte == null) { - throw new InvalidDataException("_Byte is a required property for FormatTest and cannot be null"); + throw new InvalidDataException("Byte is a required property for FormatTest and cannot be null"); } else { - this._Byte = _Byte; + this.Byte = Byte; } // to ensure "Date" is required (not null) if (Date == null) @@ -92,9 +92,9 @@ public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long this.Integer = Integer; this.Int32 = Int32; this.Int64 = Int64; - this._Float = _Float; - this._Double = _Double; - this._String = _String; + this.Float = Float; + this.Double = Double; + this.String = String; this.Binary = Binary; this.DateTime = DateTime; this.Uuid = Uuid; @@ -125,28 +125,28 @@ public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long public decimal? Number { get; set; } /// - /// Gets or Sets _Float + /// Gets or Sets Float /// [DataMember(Name="float", EmitDefaultValue=false)] - public float? _Float { get; set; } + public float? Float { get; set; } /// - /// Gets or Sets _Double + /// Gets or Sets Double /// [DataMember(Name="double", EmitDefaultValue=false)] - public double? _Double { get; set; } + public double? Double { get; set; } /// - /// Gets or Sets _String + /// Gets or Sets String /// [DataMember(Name="string", EmitDefaultValue=false)] - public string _String { get; set; } + public string String { get; set; } /// - /// Gets or Sets _Byte + /// Gets or Sets Byte /// [DataMember(Name="byte", EmitDefaultValue=false)] - public byte[] _Byte { get; set; } + public byte[] Byte { get; set; } /// /// Gets or Sets Binary @@ -191,10 +191,10 @@ public override string ToString() sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); - sb.Append(" _Float: ").Append(_Float).Append("\n"); - sb.Append(" _Double: ").Append(_Double).Append("\n"); - sb.Append(" _String: ").Append(_String).Append("\n"); - sb.Append(" _Byte: ").Append(_Byte).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); @@ -255,24 +255,24 @@ public bool Equals(FormatTest input) this.Number.Equals(input.Number)) ) && ( - this._Float == input._Float || - (this._Float != null && - this._Float.Equals(input._Float)) + this.Float == input.Float || + (this.Float != null && + this.Float.Equals(input.Float)) ) && ( - this._Double == input._Double || - (this._Double != null && - this._Double.Equals(input._Double)) + this.Double == input.Double || + (this.Double != null && + this.Double.Equals(input.Double)) ) && ( - this._String == input._String || - (this._String != null && - this._String.Equals(input._String)) + this.String == input.String || + (this.String != null && + this.String.Equals(input.String)) ) && ( - this._Byte == input._Byte || - (this._Byte != null && - this._Byte.Equals(input._Byte)) + this.Byte == input.Byte || + (this.Byte != null && + this.Byte.Equals(input.Byte)) ) && ( this.Binary == input.Binary || @@ -318,14 +318,14 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.Int64.GetHashCode(); if (this.Number != null) hashCode = hashCode * 59 + this.Number.GetHashCode(); - if (this._Float != null) - hashCode = hashCode * 59 + this._Float.GetHashCode(); - if (this._Double != null) - hashCode = hashCode * 59 + this._Double.GetHashCode(); - if (this._String != null) - hashCode = hashCode * 59 + this._String.GetHashCode(); - if (this._Byte != null) - hashCode = hashCode * 59 + this._Byte.GetHashCode(); + if (this.Float != null) + hashCode = hashCode * 59 + this.Float.GetHashCode(); + if (this.Double != null) + hashCode = hashCode * 59 + this.Double.GetHashCode(); + if (this.String != null) + hashCode = hashCode * 59 + this.String.GetHashCode(); + if (this.Byte != null) + hashCode = hashCode * 59 + this.Byte.GetHashCode(); if (this.Binary != null) hashCode = hashCode * 59 + this.Binary.GetHashCode(); if (this.Date != null) @@ -383,35 +383,35 @@ IEnumerable IValidatable yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } - // _Float (float?) maximum - if(this._Float > (float?)987.6) + // Float (float?) maximum + if(this.Float > (float?)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Float, must be a value less than or equal to 987.6.", new [] { "_Float" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } - // _Float (float?) minimum - if(this._Float < (float?)54.3) + // Float (float?) minimum + if(this.Float < (float?)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Float, must be a value greater than or equal to 54.3.", new [] { "_Float" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } - // _Double (double?) maximum - if(this._Double > (double?)123.4) + // Double (double?) maximum + if(this.Double > (double?)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Double, must be a value less than or equal to 123.4.", new [] { "_Double" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } - // _Double (double?) minimum - if(this._Double < (double?)67.8) + // Double (double?) minimum + if(this.Double < (double?)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Double, must be a value greater than or equal to 67.8.", new [] { "_Double" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } - // _String (string) pattern - Regex regex_String = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (false == regex_String.Match(this._String).Success) + // String (string) pattern + Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + if (false == regexString.Match(this.String).Success) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _String, must match a pattern of " + regex_String, new [] { "_String" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); } // Password (string) maxLength diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Model200Response.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Model200Response.cs index 71b4d96c8714..ece573ce162e 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Model200Response.cs @@ -34,11 +34,11 @@ public partial class Model200Response : IEquatable, IValidata /// Initializes a new instance of the class. /// /// Name. - /// _Class. - public Model200Response(int? Name = default(int?), string _Class = default(string)) + /// Class. + public Model200Response(int? Name = default(int?), string Class = default(string)) { this.Name = Name; - this._Class = _Class; + this.Class = Class; } /// @@ -48,10 +48,10 @@ public Model200Response(int? Name = default(int?), string _Class = default(strin public int? Name { get; set; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -62,7 +62,7 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class Model200Response {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" _Class: ").Append(_Class).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -103,9 +103,9 @@ public bool Equals(Model200Response input) this.Name.Equals(input.Name)) ) && ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -120,8 +120,8 @@ public override int GetHashCode() int hashCode = 41; if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ModelClient.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ModelClient.cs index a01c9487ce66..117463e0bf4d 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ModelClient.cs @@ -33,17 +33,17 @@ public partial class ModelClient : IEquatable, IValidatableObject /// /// Initializes a new instance of the class. /// - /// _Client. - public ModelClient(string _Client = default(string)) + /// __Client. + public ModelClient(string __Client = default(string)) { - this._Client = _Client; + this.__Client = __Client; } /// - /// Gets or Sets _Client + /// Gets or Sets __Client /// [DataMember(Name="client", EmitDefaultValue=false)] - public string _Client { get; set; } + public string __Client { get; set; } /// /// Returns the string presentation of the object @@ -53,7 +53,7 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class ModelClient {\n"); - sb.Append(" _Client: ").Append(_Client).Append("\n"); + sb.Append(" __Client: ").Append(__Client).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -89,9 +89,9 @@ public bool Equals(ModelClient input) return ( - this._Client == input._Client || - (this._Client != null && - this._Client.Equals(input._Client)) + this.__Client == input.__Client || + (this.__Client != null && + this.__Client.Equals(input.__Client)) ); } @@ -104,8 +104,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Client != null) - hashCode = hashCode * 59 + this._Client.GetHashCode(); + if (this.__Client != null) + hashCode = hashCode * 59 + this.__Client.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs new file mode 100644 index 000000000000..39b03628206f --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs @@ -0,0 +1,124 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing reserved words + /// + [DataContract] + public partial class Return : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _Return. + public Return(int? _Return = default(int?)) + { + this._Return = _Return; + } + + /// + /// Gets or Sets _Return + /// + [DataMember(Name="return", EmitDefaultValue=false)] + public int? _Return { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Return {\n"); + sb.Append(" _Return: ").Append(_Return).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Return); + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + if (input == null) + return false; + + return + ( + this._Return == input._Return || + (this._Return != null && + this._Return.Equals(input._Return)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Return != null) + hashCode = hashCode * 59 + this._Return.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/README.md b/samples/client/petstore/csharp/SwaggerClientNet35/README.md index 7b5b59a8dcbb..8e64bcaf148b 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/README.md +++ b/samples/client/petstore/csharp/SwaggerClientNet35/README.md @@ -152,7 +152,6 @@ Class | Method | HTTP request | Description - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) - - [Model.ModelReturn](docs/ModelReturn.md) - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) - [Model.Order](docs/Order.md) @@ -163,6 +162,7 @@ Class | Method | HTTP request | Description - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/docs/ClassModel.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/ClassModel.md index 760130f053cf..9bfd15db501d 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/docs/ClassModel.md +++ b/samples/client/petstore/csharp/SwaggerClientNet35/docs/ClassModel.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Class** | **string** | | [optional] +**Class** | **string** | | [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/SwaggerClientNet35/docs/FormatTest.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/FormatTest.md index 1d366bd7cab4..1108a1af428b 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/docs/FormatTest.md +++ b/samples/client/petstore/csharp/SwaggerClientNet35/docs/FormatTest.md @@ -7,10 +7,10 @@ Name | Type | Description | Notes **Int32** | **int?** | | [optional] **Int64** | **long?** | | [optional] **Number** | **decimal?** | | -**_Float** | **float?** | | [optional] -**_Double** | **double?** | | [optional] -**_String** | **string** | | [optional] -**_Byte** | **byte[]** | | +**Float** | **float?** | | [optional] +**Double** | **double?** | | [optional] +**String** | **string** | | [optional] +**Byte** | **byte[]** | | **Binary** | **byte[]** | | [optional] **Date** | **DateTime?** | | **DateTime** | **DateTime?** | | [optional] diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/docs/Model200Response.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/Model200Response.md index cfaddb67027e..62db21288f2b 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/docs/Model200Response.md +++ b/samples/client/petstore/csharp/SwaggerClientNet35/docs/Model200Response.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **int?** | | [optional] -**_Class** | **string** | | [optional] +**Class** | **string** | | [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/SwaggerClientNet35/docs/ModelClient.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/ModelClient.md index 9ecdc0e11410..c3817230640d 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/docs/ModelClient.md +++ b/samples/client/petstore/csharp/SwaggerClientNet35/docs/ModelClient.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Client** | **string** | | [optional] +**__Client** | **string** | | [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/SwaggerClientNet35/docs/Return.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/Return.md new file mode 100644 index 000000000000..9a9559907c14 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet35/docs/Return.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.Return +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int?** | | [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/SwaggerClientNet35/src/IO.Swagger.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/ReturnTests.cs new file mode 100644 index 000000000000..ec2a68a5fbb5 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/ReturnTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Return + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ReturnTests + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Return + /// + [Test] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Return + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Return"); + } + + + /// + /// Test the property '_Return' + /// + [Test] + public void _ReturnTest() + { + // TODO unit test for the property '_Return' + } + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ClassModel.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ClassModel.cs index cf9f0eed3d23..54842287cf6b 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ClassModel.cs @@ -33,17 +33,17 @@ public partial class ClassModel : IEquatable /// /// Initializes a new instance of the class. /// - /// _Class. - public ClassModel(string _Class = default(string)) + /// Class. + public ClassModel(string Class = default(string)) { - this._Class = _Class; + this.Class = Class; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="_class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -53,7 +53,7 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class ClassModel {\n"); - sb.Append(" _Class: ").Append(_Class).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -89,9 +89,9 @@ public bool Equals(ClassModel input) return ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -104,8 +104,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/FormatTest.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/FormatTest.cs index 9d8c19975234..02f96e6c5be8 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/FormatTest.cs @@ -42,16 +42,16 @@ public partial class FormatTest : IEquatable /// Int32. /// Int64. /// Number (required). - /// _Float. - /// _Double. - /// _String. - /// _Byte (required). + /// Float. + /// Double. + /// String. + /// Byte (required). /// Binary. /// Date (required). /// DateTime. /// Uuid. /// Password (required). - public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long? Int64 = default(long?), decimal? Number = default(decimal?), float? _Float = default(float?), double? _Double = default(double?), string _String = default(string), byte[] _Byte = default(byte[]), byte[] Binary = default(byte[]), DateTime? Date = default(DateTime?), DateTime? DateTime = default(DateTime?), Guid? Uuid = default(Guid?), string Password = default(string)) + public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long? Int64 = default(long?), decimal? Number = default(decimal?), float? Float = default(float?), double? Double = default(double?), string String = default(string), byte[] Byte = default(byte[]), byte[] Binary = default(byte[]), DateTime? Date = default(DateTime?), DateTime? DateTime = default(DateTime?), Guid? Uuid = default(Guid?), string Password = default(string)) { // to ensure "Number" is required (not null) if (Number == null) @@ -62,14 +62,14 @@ public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long { this.Number = Number; } - // to ensure "_Byte" is required (not null) - if (_Byte == null) + // to ensure "Byte" is required (not null) + if (Byte == null) { - throw new InvalidDataException("_Byte is a required property for FormatTest and cannot be null"); + throw new InvalidDataException("Byte is a required property for FormatTest and cannot be null"); } else { - this._Byte = _Byte; + this.Byte = Byte; } // to ensure "Date" is required (not null) if (Date == null) @@ -92,9 +92,9 @@ public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long this.Integer = Integer; this.Int32 = Int32; this.Int64 = Int64; - this._Float = _Float; - this._Double = _Double; - this._String = _String; + this.Float = Float; + this.Double = Double; + this.String = String; this.Binary = Binary; this.DateTime = DateTime; this.Uuid = Uuid; @@ -125,28 +125,28 @@ public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long public decimal? Number { get; set; } /// - /// Gets or Sets _Float + /// Gets or Sets Float /// [DataMember(Name="float", EmitDefaultValue=false)] - public float? _Float { get; set; } + public float? Float { get; set; } /// - /// Gets or Sets _Double + /// Gets or Sets Double /// [DataMember(Name="double", EmitDefaultValue=false)] - public double? _Double { get; set; } + public double? Double { get; set; } /// - /// Gets or Sets _String + /// Gets or Sets String /// [DataMember(Name="string", EmitDefaultValue=false)] - public string _String { get; set; } + public string String { get; set; } /// - /// Gets or Sets _Byte + /// Gets or Sets Byte /// [DataMember(Name="byte", EmitDefaultValue=false)] - public byte[] _Byte { get; set; } + public byte[] Byte { get; set; } /// /// Gets or Sets Binary @@ -191,10 +191,10 @@ public override string ToString() sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); - sb.Append(" _Float: ").Append(_Float).Append("\n"); - sb.Append(" _Double: ").Append(_Double).Append("\n"); - sb.Append(" _String: ").Append(_String).Append("\n"); - sb.Append(" _Byte: ").Append(_Byte).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); @@ -255,24 +255,24 @@ public bool Equals(FormatTest input) this.Number.Equals(input.Number)) ) && ( - this._Float == input._Float || - (this._Float != null && - this._Float.Equals(input._Float)) + this.Float == input.Float || + (this.Float != null && + this.Float.Equals(input.Float)) ) && ( - this._Double == input._Double || - (this._Double != null && - this._Double.Equals(input._Double)) + this.Double == input.Double || + (this.Double != null && + this.Double.Equals(input.Double)) ) && ( - this._String == input._String || - (this._String != null && - this._String.Equals(input._String)) + this.String == input.String || + (this.String != null && + this.String.Equals(input.String)) ) && ( - this._Byte == input._Byte || - (this._Byte != null && - this._Byte.Equals(input._Byte)) + this.Byte == input.Byte || + (this.Byte != null && + this.Byte.Equals(input.Byte)) ) && ( this.Binary == input.Binary || @@ -318,14 +318,14 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.Int64.GetHashCode(); if (this.Number != null) hashCode = hashCode * 59 + this.Number.GetHashCode(); - if (this._Float != null) - hashCode = hashCode * 59 + this._Float.GetHashCode(); - if (this._Double != null) - hashCode = hashCode * 59 + this._Double.GetHashCode(); - if (this._String != null) - hashCode = hashCode * 59 + this._String.GetHashCode(); - if (this._Byte != null) - hashCode = hashCode * 59 + this._Byte.GetHashCode(); + if (this.Float != null) + hashCode = hashCode * 59 + this.Float.GetHashCode(); + if (this.Double != null) + hashCode = hashCode * 59 + this.Double.GetHashCode(); + if (this.String != null) + hashCode = hashCode * 59 + this.String.GetHashCode(); + if (this.Byte != null) + hashCode = hashCode * 59 + this.Byte.GetHashCode(); if (this.Binary != null) hashCode = hashCode * 59 + this.Binary.GetHashCode(); if (this.Date != null) diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Model200Response.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Model200Response.cs index 331923b20ffd..d81f20e57570 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Model200Response.cs @@ -34,11 +34,11 @@ public partial class Model200Response : IEquatable /// Initializes a new instance of the class. /// /// Name. - /// _Class. - public Model200Response(int? Name = default(int?), string _Class = default(string)) + /// Class. + public Model200Response(int? Name = default(int?), string Class = default(string)) { this.Name = Name; - this._Class = _Class; + this.Class = Class; } /// @@ -48,10 +48,10 @@ public Model200Response(int? Name = default(int?), string _Class = default(strin public int? Name { get; set; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -62,7 +62,7 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class Model200Response {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" _Class: ").Append(_Class).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -103,9 +103,9 @@ public bool Equals(Model200Response input) this.Name.Equals(input.Name)) ) && ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -120,8 +120,8 @@ public override int GetHashCode() int hashCode = 41; if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ModelClient.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ModelClient.cs index a971e66e192f..db5426bfb05d 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ModelClient.cs @@ -33,17 +33,17 @@ public partial class ModelClient : IEquatable /// /// Initializes a new instance of the class. /// - /// _Client. - public ModelClient(string _Client = default(string)) + /// __Client. + public ModelClient(string __Client = default(string)) { - this._Client = _Client; + this.__Client = __Client; } /// - /// Gets or Sets _Client + /// Gets or Sets __Client /// [DataMember(Name="client", EmitDefaultValue=false)] - public string _Client { get; set; } + public string __Client { get; set; } /// /// Returns the string presentation of the object @@ -53,7 +53,7 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class ModelClient {\n"); - sb.Append(" _Client: ").Append(_Client).Append("\n"); + sb.Append(" __Client: ").Append(__Client).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -89,9 +89,9 @@ public bool Equals(ModelClient input) return ( - this._Client == input._Client || - (this._Client != null && - this._Client.Equals(input._Client)) + this.__Client == input.__Client || + (this.__Client != null && + this.__Client.Equals(input.__Client)) ); } @@ -104,8 +104,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Client != null) - hashCode = hashCode * 59 + this._Client.GetHashCode(); + if (this.__Client != null) + hashCode = hashCode * 59 + this.__Client.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Return.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Return.cs new file mode 100644 index 000000000000..0743d0ffa754 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Return.cs @@ -0,0 +1,115 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing reserved words + /// + [DataContract] + public partial class Return : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// _Return. + public Return(int? _Return = default(int?)) + { + this._Return = _Return; + } + + /// + /// Gets or Sets _Return + /// + [DataMember(Name="return", EmitDefaultValue=false)] + public int? _Return { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Return {\n"); + sb.Append(" _Return: ").Append(_Return).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Return); + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + if (input == null) + return false; + + return + ( + this._Return == input._Return || + (this._Return != null && + this._Return.Equals(input._Return)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Return != null) + hashCode = hashCode * 59 + this._Return.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/README.md b/samples/client/petstore/csharp/SwaggerClientNet40/README.md index 7b5b59a8dcbb..8e64bcaf148b 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/README.md +++ b/samples/client/petstore/csharp/SwaggerClientNet40/README.md @@ -152,7 +152,6 @@ Class | Method | HTTP request | Description - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) - - [Model.ModelReturn](docs/ModelReturn.md) - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) - [Model.Order](docs/Order.md) @@ -163,6 +162,7 @@ Class | Method | HTTP request | Description - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/docs/ClassModel.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/ClassModel.md index 760130f053cf..9bfd15db501d 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/docs/ClassModel.md +++ b/samples/client/petstore/csharp/SwaggerClientNet40/docs/ClassModel.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Class** | **string** | | [optional] +**Class** | **string** | | [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/SwaggerClientNet40/docs/FormatTest.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/FormatTest.md index 1d366bd7cab4..1108a1af428b 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/docs/FormatTest.md +++ b/samples/client/petstore/csharp/SwaggerClientNet40/docs/FormatTest.md @@ -7,10 +7,10 @@ Name | Type | Description | Notes **Int32** | **int?** | | [optional] **Int64** | **long?** | | [optional] **Number** | **decimal?** | | -**_Float** | **float?** | | [optional] -**_Double** | **double?** | | [optional] -**_String** | **string** | | [optional] -**_Byte** | **byte[]** | | +**Float** | **float?** | | [optional] +**Double** | **double?** | | [optional] +**String** | **string** | | [optional] +**Byte** | **byte[]** | | **Binary** | **byte[]** | | [optional] **Date** | **DateTime?** | | **DateTime** | **DateTime?** | | [optional] diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/docs/Model200Response.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/Model200Response.md index cfaddb67027e..62db21288f2b 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/docs/Model200Response.md +++ b/samples/client/petstore/csharp/SwaggerClientNet40/docs/Model200Response.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **int?** | | [optional] -**_Class** | **string** | | [optional] +**Class** | **string** | | [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/SwaggerClientNet40/docs/ModelClient.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/ModelClient.md index 9ecdc0e11410..c3817230640d 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/docs/ModelClient.md +++ b/samples/client/petstore/csharp/SwaggerClientNet40/docs/ModelClient.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Client** | **string** | | [optional] +**__Client** | **string** | | [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/SwaggerClientNet40/docs/Return.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/Return.md new file mode 100644 index 000000000000..9a9559907c14 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet40/docs/Return.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.Return +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int?** | | [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/SwaggerClientNet40/src/IO.Swagger.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/ReturnTests.cs new file mode 100644 index 000000000000..ec2a68a5fbb5 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/ReturnTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Return + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ReturnTests + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Return + /// + [Test] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Return + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Return"); + } + + + /// + /// Test the property '_Return' + /// + [Test] + public void _ReturnTest() + { + // TODO unit test for the property '_Return' + } + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ClassModel.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ClassModel.cs index cccdd843f007..cd82cd31dece 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ClassModel.cs @@ -33,17 +33,17 @@ public partial class ClassModel : IEquatable, IValidatableObject /// /// Initializes a new instance of the class. /// - /// _Class. - public ClassModel(string _Class = default(string)) + /// Class. + public ClassModel(string Class = default(string)) { - this._Class = _Class; + this.Class = Class; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="_class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -53,7 +53,7 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class ClassModel {\n"); - sb.Append(" _Class: ").Append(_Class).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -89,9 +89,9 @@ public bool Equals(ClassModel input) return ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -104,8 +104,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/FormatTest.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/FormatTest.cs index 25e6c7925f30..4a0c3f973834 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/FormatTest.cs @@ -42,16 +42,16 @@ public partial class FormatTest : IEquatable, IValidatableObject /// Int32. /// Int64. /// Number (required). - /// _Float. - /// _Double. - /// _String. - /// _Byte (required). + /// Float. + /// Double. + /// String. + /// Byte (required). /// Binary. /// Date (required). /// DateTime. /// Uuid. /// Password (required). - public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long? Int64 = default(long?), decimal? Number = default(decimal?), float? _Float = default(float?), double? _Double = default(double?), string _String = default(string), byte[] _Byte = default(byte[]), byte[] Binary = default(byte[]), DateTime? Date = default(DateTime?), DateTime? DateTime = default(DateTime?), Guid? Uuid = default(Guid?), string Password = default(string)) + public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long? Int64 = default(long?), decimal? Number = default(decimal?), float? Float = default(float?), double? Double = default(double?), string String = default(string), byte[] Byte = default(byte[]), byte[] Binary = default(byte[]), DateTime? Date = default(DateTime?), DateTime? DateTime = default(DateTime?), Guid? Uuid = default(Guid?), string Password = default(string)) { // to ensure "Number" is required (not null) if (Number == null) @@ -62,14 +62,14 @@ public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long { this.Number = Number; } - // to ensure "_Byte" is required (not null) - if (_Byte == null) + // to ensure "Byte" is required (not null) + if (Byte == null) { - throw new InvalidDataException("_Byte is a required property for FormatTest and cannot be null"); + throw new InvalidDataException("Byte is a required property for FormatTest and cannot be null"); } else { - this._Byte = _Byte; + this.Byte = Byte; } // to ensure "Date" is required (not null) if (Date == null) @@ -92,9 +92,9 @@ public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long this.Integer = Integer; this.Int32 = Int32; this.Int64 = Int64; - this._Float = _Float; - this._Double = _Double; - this._String = _String; + this.Float = Float; + this.Double = Double; + this.String = String; this.Binary = Binary; this.DateTime = DateTime; this.Uuid = Uuid; @@ -125,28 +125,28 @@ public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long public decimal? Number { get; set; } /// - /// Gets or Sets _Float + /// Gets or Sets Float /// [DataMember(Name="float", EmitDefaultValue=false)] - public float? _Float { get; set; } + public float? Float { get; set; } /// - /// Gets or Sets _Double + /// Gets or Sets Double /// [DataMember(Name="double", EmitDefaultValue=false)] - public double? _Double { get; set; } + public double? Double { get; set; } /// - /// Gets or Sets _String + /// Gets or Sets String /// [DataMember(Name="string", EmitDefaultValue=false)] - public string _String { get; set; } + public string String { get; set; } /// - /// Gets or Sets _Byte + /// Gets or Sets Byte /// [DataMember(Name="byte", EmitDefaultValue=false)] - public byte[] _Byte { get; set; } + public byte[] Byte { get; set; } /// /// Gets or Sets Binary @@ -191,10 +191,10 @@ public override string ToString() sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); - sb.Append(" _Float: ").Append(_Float).Append("\n"); - sb.Append(" _Double: ").Append(_Double).Append("\n"); - sb.Append(" _String: ").Append(_String).Append("\n"); - sb.Append(" _Byte: ").Append(_Byte).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); @@ -255,24 +255,24 @@ public bool Equals(FormatTest input) this.Number.Equals(input.Number)) ) && ( - this._Float == input._Float || - (this._Float != null && - this._Float.Equals(input._Float)) + this.Float == input.Float || + (this.Float != null && + this.Float.Equals(input.Float)) ) && ( - this._Double == input._Double || - (this._Double != null && - this._Double.Equals(input._Double)) + this.Double == input.Double || + (this.Double != null && + this.Double.Equals(input.Double)) ) && ( - this._String == input._String || - (this._String != null && - this._String.Equals(input._String)) + this.String == input.String || + (this.String != null && + this.String.Equals(input.String)) ) && ( - this._Byte == input._Byte || - (this._Byte != null && - this._Byte.Equals(input._Byte)) + this.Byte == input.Byte || + (this.Byte != null && + this.Byte.Equals(input.Byte)) ) && ( this.Binary == input.Binary || @@ -318,14 +318,14 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.Int64.GetHashCode(); if (this.Number != null) hashCode = hashCode * 59 + this.Number.GetHashCode(); - if (this._Float != null) - hashCode = hashCode * 59 + this._Float.GetHashCode(); - if (this._Double != null) - hashCode = hashCode * 59 + this._Double.GetHashCode(); - if (this._String != null) - hashCode = hashCode * 59 + this._String.GetHashCode(); - if (this._Byte != null) - hashCode = hashCode * 59 + this._Byte.GetHashCode(); + if (this.Float != null) + hashCode = hashCode * 59 + this.Float.GetHashCode(); + if (this.Double != null) + hashCode = hashCode * 59 + this.Double.GetHashCode(); + if (this.String != null) + hashCode = hashCode * 59 + this.String.GetHashCode(); + if (this.Byte != null) + hashCode = hashCode * 59 + this.Byte.GetHashCode(); if (this.Binary != null) hashCode = hashCode * 59 + this.Binary.GetHashCode(); if (this.Date != null) @@ -383,35 +383,35 @@ IEnumerable IValidatable yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } - // _Float (float?) maximum - if(this._Float > (float?)987.6) + // Float (float?) maximum + if(this.Float > (float?)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Float, must be a value less than or equal to 987.6.", new [] { "_Float" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } - // _Float (float?) minimum - if(this._Float < (float?)54.3) + // Float (float?) minimum + if(this.Float < (float?)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Float, must be a value greater than or equal to 54.3.", new [] { "_Float" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } - // _Double (double?) maximum - if(this._Double > (double?)123.4) + // Double (double?) maximum + if(this.Double > (double?)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Double, must be a value less than or equal to 123.4.", new [] { "_Double" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } - // _Double (double?) minimum - if(this._Double < (double?)67.8) + // Double (double?) minimum + if(this.Double < (double?)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Double, must be a value greater than or equal to 67.8.", new [] { "_Double" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } - // _String (string) pattern - Regex regex_String = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (false == regex_String.Match(this._String).Success) + // String (string) pattern + Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + if (false == regexString.Match(this.String).Success) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _String, must match a pattern of " + regex_String, new [] { "_String" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); } // Password (string) maxLength diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Model200Response.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Model200Response.cs index 71b4d96c8714..ece573ce162e 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Model200Response.cs @@ -34,11 +34,11 @@ public partial class Model200Response : IEquatable, IValidata /// Initializes a new instance of the class. /// /// Name. - /// _Class. - public Model200Response(int? Name = default(int?), string _Class = default(string)) + /// Class. + public Model200Response(int? Name = default(int?), string Class = default(string)) { this.Name = Name; - this._Class = _Class; + this.Class = Class; } /// @@ -48,10 +48,10 @@ public Model200Response(int? Name = default(int?), string _Class = default(strin public int? Name { get; set; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -62,7 +62,7 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class Model200Response {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" _Class: ").Append(_Class).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -103,9 +103,9 @@ public bool Equals(Model200Response input) this.Name.Equals(input.Name)) ) && ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -120,8 +120,8 @@ public override int GetHashCode() int hashCode = 41; if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ModelClient.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ModelClient.cs index a01c9487ce66..117463e0bf4d 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ModelClient.cs @@ -33,17 +33,17 @@ public partial class ModelClient : IEquatable, IValidatableObject /// /// Initializes a new instance of the class. /// - /// _Client. - public ModelClient(string _Client = default(string)) + /// __Client. + public ModelClient(string __Client = default(string)) { - this._Client = _Client; + this.__Client = __Client; } /// - /// Gets or Sets _Client + /// Gets or Sets __Client /// [DataMember(Name="client", EmitDefaultValue=false)] - public string _Client { get; set; } + public string __Client { get; set; } /// /// Returns the string presentation of the object @@ -53,7 +53,7 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class ModelClient {\n"); - sb.Append(" _Client: ").Append(_Client).Append("\n"); + sb.Append(" __Client: ").Append(__Client).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -89,9 +89,9 @@ public bool Equals(ModelClient input) return ( - this._Client == input._Client || - (this._Client != null && - this._Client.Equals(input._Client)) + this.__Client == input.__Client || + (this.__Client != null && + this.__Client.Equals(input.__Client)) ); } @@ -104,8 +104,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Client != null) - hashCode = hashCode * 59 + this._Client.GetHashCode(); + if (this.__Client != null) + hashCode = hashCode * 59 + this.__Client.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Return.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Return.cs new file mode 100644 index 000000000000..39b03628206f --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Return.cs @@ -0,0 +1,124 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing reserved words + /// + [DataContract] + public partial class Return : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _Return. + public Return(int? _Return = default(int?)) + { + this._Return = _Return; + } + + /// + /// Gets or Sets _Return + /// + [DataMember(Name="return", EmitDefaultValue=false)] + public int? _Return { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Return {\n"); + sb.Append(" _Return: ").Append(_Return).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Return); + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + if (input == null) + return false; + + return + ( + this._Return == input._Return || + (this._Return != null && + this._Return.Equals(input._Return)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Return != null) + hashCode = hashCode * 59 + this._Return.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/README.md b/samples/client/petstore/csharp/SwaggerClientNetStandard/README.md index 0e226b9c0e63..10eef36cdd0a 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/README.md +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/README.md @@ -130,7 +130,6 @@ Class | Method | HTTP request | Description - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) - - [Model.ModelReturn](docs/ModelReturn.md) - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) - [Model.Order](docs/Order.md) @@ -141,6 +140,7 @@ Class | Method | HTTP request | Description - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/ClassModel.md b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/ClassModel.md index 760130f053cf..9bfd15db501d 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/ClassModel.md +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/ClassModel.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Class** | **string** | | [optional] +**Class** | **string** | | [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/SwaggerClientNetStandard/docs/FormatTest.md b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/FormatTest.md index 1d366bd7cab4..1108a1af428b 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/FormatTest.md +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/FormatTest.md @@ -7,10 +7,10 @@ Name | Type | Description | Notes **Int32** | **int?** | | [optional] **Int64** | **long?** | | [optional] **Number** | **decimal?** | | -**_Float** | **float?** | | [optional] -**_Double** | **double?** | | [optional] -**_String** | **string** | | [optional] -**_Byte** | **byte[]** | | +**Float** | **float?** | | [optional] +**Double** | **double?** | | [optional] +**String** | **string** | | [optional] +**Byte** | **byte[]** | | **Binary** | **byte[]** | | [optional] **Date** | **DateTime?** | | **DateTime** | **DateTime?** | | [optional] diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/Model200Response.md b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/Model200Response.md index cfaddb67027e..62db21288f2b 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/Model200Response.md +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/Model200Response.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **int?** | | [optional] -**_Class** | **string** | | [optional] +**Class** | **string** | | [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/SwaggerClientNetStandard/docs/ModelClient.md b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/ModelClient.md index 9ecdc0e11410..c3817230640d 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/ModelClient.md +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/ModelClient.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Client** | **string** | | [optional] +**__Client** | **string** | | [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/SwaggerClientNetStandard/docs/Return.md b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/Return.md new file mode 100644 index 000000000000..9a9559907c14 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/docs/Return.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.Return +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int?** | | [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/SwaggerClientNetStandard/src/IO.Swagger/Model/ClassModel.cs b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/ClassModel.cs index 3fcff106b2a1..67e9e204d0af 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/ClassModel.cs @@ -31,17 +31,17 @@ public partial class ClassModel : IEquatable /// /// Initializes a new instance of the class. /// - /// _Class. - public ClassModel(string _Class = default(string)) + /// Class. + public ClassModel(string Class = default(string)) { - this._Class = _Class; + this.Class = Class; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="_class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -51,7 +51,7 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class ClassModel {\n"); - sb.Append(" _Class: ").Append(_Class).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -87,9 +87,9 @@ public bool Equals(ClassModel input) return ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -102,8 +102,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/FormatTest.cs b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/FormatTest.cs index 6ea25d953f0f..8507759542f0 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/FormatTest.cs @@ -40,16 +40,16 @@ public partial class FormatTest : IEquatable /// Int32. /// Int64. /// Number (required). - /// _Float. - /// _Double. - /// _String. - /// _Byte (required). + /// Float. + /// Double. + /// String. + /// Byte (required). /// Binary. /// Date (required). /// DateTime. /// Uuid. /// Password (required). - public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long? Int64 = default(long?), decimal? Number = default(decimal?), float? _Float = default(float?), double? _Double = default(double?), string _String = default(string), byte[] _Byte = default(byte[]), byte[] Binary = default(byte[]), DateTime? Date = default(DateTime?), DateTime? DateTime = default(DateTime?), Guid? Uuid = default(Guid?), string Password = default(string)) + public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long? Int64 = default(long?), decimal? Number = default(decimal?), float? Float = default(float?), double? Double = default(double?), string String = default(string), byte[] Byte = default(byte[]), byte[] Binary = default(byte[]), DateTime? Date = default(DateTime?), DateTime? DateTime = default(DateTime?), Guid? Uuid = default(Guid?), string Password = default(string)) { // to ensure "Number" is required (not null) if (Number == null) @@ -60,14 +60,14 @@ public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long { this.Number = Number; } - // to ensure "_Byte" is required (not null) - if (_Byte == null) + // to ensure "Byte" is required (not null) + if (Byte == null) { - throw new InvalidDataException("_Byte is a required property for FormatTest and cannot be null"); + throw new InvalidDataException("Byte is a required property for FormatTest and cannot be null"); } else { - this._Byte = _Byte; + this.Byte = Byte; } // to ensure "Date" is required (not null) if (Date == null) @@ -90,9 +90,9 @@ public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long this.Integer = Integer; this.Int32 = Int32; this.Int64 = Int64; - this._Float = _Float; - this._Double = _Double; - this._String = _String; + this.Float = Float; + this.Double = Double; + this.String = String; this.Binary = Binary; this.DateTime = DateTime; this.Uuid = Uuid; @@ -123,28 +123,28 @@ public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long public decimal? Number { get; set; } /// - /// Gets or Sets _Float + /// Gets or Sets Float /// [DataMember(Name="float", EmitDefaultValue=false)] - public float? _Float { get; set; } + public float? Float { get; set; } /// - /// Gets or Sets _Double + /// Gets or Sets Double /// [DataMember(Name="double", EmitDefaultValue=false)] - public double? _Double { get; set; } + public double? Double { get; set; } /// - /// Gets or Sets _String + /// Gets or Sets String /// [DataMember(Name="string", EmitDefaultValue=false)] - public string _String { get; set; } + public string String { get; set; } /// - /// Gets or Sets _Byte + /// Gets or Sets Byte /// [DataMember(Name="byte", EmitDefaultValue=false)] - public byte[] _Byte { get; set; } + public byte[] Byte { get; set; } /// /// Gets or Sets Binary @@ -189,10 +189,10 @@ public override string ToString() sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); - sb.Append(" _Float: ").Append(_Float).Append("\n"); - sb.Append(" _Double: ").Append(_Double).Append("\n"); - sb.Append(" _String: ").Append(_String).Append("\n"); - sb.Append(" _Byte: ").Append(_Byte).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); @@ -253,24 +253,24 @@ public bool Equals(FormatTest input) this.Number.Equals(input.Number)) ) && ( - this._Float == input._Float || - (this._Float != null && - this._Float.Equals(input._Float)) + this.Float == input.Float || + (this.Float != null && + this.Float.Equals(input.Float)) ) && ( - this._Double == input._Double || - (this._Double != null && - this._Double.Equals(input._Double)) + this.Double == input.Double || + (this.Double != null && + this.Double.Equals(input.Double)) ) && ( - this._String == input._String || - (this._String != null && - this._String.Equals(input._String)) + this.String == input.String || + (this.String != null && + this.String.Equals(input.String)) ) && ( - this._Byte == input._Byte || - (this._Byte != null && - this._Byte.Equals(input._Byte)) + this.Byte == input.Byte || + (this.Byte != null && + this.Byte.Equals(input.Byte)) ) && ( this.Binary == input.Binary || @@ -316,14 +316,14 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.Int64.GetHashCode(); if (this.Number != null) hashCode = hashCode * 59 + this.Number.GetHashCode(); - if (this._Float != null) - hashCode = hashCode * 59 + this._Float.GetHashCode(); - if (this._Double != null) - hashCode = hashCode * 59 + this._Double.GetHashCode(); - if (this._String != null) - hashCode = hashCode * 59 + this._String.GetHashCode(); - if (this._Byte != null) - hashCode = hashCode * 59 + this._Byte.GetHashCode(); + if (this.Float != null) + hashCode = hashCode * 59 + this.Float.GetHashCode(); + if (this.Double != null) + hashCode = hashCode * 59 + this.Double.GetHashCode(); + if (this.String != null) + hashCode = hashCode * 59 + this.String.GetHashCode(); + if (this.Byte != null) + hashCode = hashCode * 59 + this.Byte.GetHashCode(); if (this.Binary != null) hashCode = hashCode * 59 + this.Binary.GetHashCode(); if (this.Date != null) diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/Model200Response.cs b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/Model200Response.cs index 1a6eb33e334d..a0ea98056e65 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/Model200Response.cs @@ -32,11 +32,11 @@ public partial class Model200Response : IEquatable /// Initializes a new instance of the class. /// /// Name. - /// _Class. - public Model200Response(int? Name = default(int?), string _Class = default(string)) + /// Class. + public Model200Response(int? Name = default(int?), string Class = default(string)) { this.Name = Name; - this._Class = _Class; + this.Class = Class; } /// @@ -46,10 +46,10 @@ public Model200Response(int? Name = default(int?), string _Class = default(strin public int? Name { get; set; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -60,7 +60,7 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class Model200Response {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" _Class: ").Append(_Class).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -101,9 +101,9 @@ public bool Equals(Model200Response input) this.Name.Equals(input.Name)) ) && ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -118,8 +118,8 @@ public override int GetHashCode() int hashCode = 41; if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/ModelClient.cs b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/ModelClient.cs index 13f8f0cff52d..cd1aee27b4cd 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/ModelClient.cs @@ -31,17 +31,17 @@ public partial class ModelClient : IEquatable /// /// Initializes a new instance of the class. /// - /// _Client. - public ModelClient(string _Client = default(string)) + /// __Client. + public ModelClient(string __Client = default(string)) { - this._Client = _Client; + this.__Client = __Client; } /// - /// Gets or Sets _Client + /// Gets or Sets __Client /// [DataMember(Name="client", EmitDefaultValue=false)] - public string _Client { get; set; } + public string __Client { get; set; } /// /// Returns the string presentation of the object @@ -51,7 +51,7 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class ModelClient {\n"); - sb.Append(" _Client: ").Append(_Client).Append("\n"); + sb.Append(" __Client: ").Append(__Client).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -87,9 +87,9 @@ public bool Equals(ModelClient input) return ( - this._Client == input._Client || - (this._Client != null && - this._Client.Equals(input._Client)) + this.__Client == input.__Client || + (this.__Client != null && + this.__Client.Equals(input.__Client)) ); } @@ -102,8 +102,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Client != null) - hashCode = hashCode * 59 + this._Client.GetHashCode(); + if (this.__Client != null) + hashCode = hashCode * 59 + this.__Client.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/Return.cs b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/Return.cs new file mode 100644 index 000000000000..b11bad752f98 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Model/Return.cs @@ -0,0 +1,112 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing reserved words + /// + [DataContract] + public partial class Return : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// _Return. + public Return(int? _Return = default(int?)) + { + this._Return = _Return; + } + + /// + /// Gets or Sets _Return + /// + [DataMember(Name="return", EmitDefaultValue=false)] + public int? _Return { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Return {\n"); + sb.Append(" _Return: ").Append(_Return).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Return); + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + if (input == null) + return false; + + return + ( + this._Return == input._Return || + (this._Return != null && + this._Return.Equals(input._Return)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Return != null) + hashCode = hashCode * 59 + this._Return.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md index 7b5b59a8dcbb..8e64bcaf148b 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md @@ -152,7 +152,6 @@ Class | Method | HTTP request | Description - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) - - [Model.ModelReturn](docs/ModelReturn.md) - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) - [Model.Order](docs/Order.md) @@ -163,6 +162,7 @@ Class | Method | HTTP request | Description - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/ClassModel.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/ClassModel.md index 760130f053cf..9bfd15db501d 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/ClassModel.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/ClassModel.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Class** | **string** | | [optional] +**Class** | **string** | | [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/SwaggerClientWithPropertyChanged/docs/FormatTest.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/FormatTest.md index 1d366bd7cab4..1108a1af428b 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/FormatTest.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/FormatTest.md @@ -7,10 +7,10 @@ Name | Type | Description | Notes **Int32** | **int?** | | [optional] **Int64** | **long?** | | [optional] **Number** | **decimal?** | | -**_Float** | **float?** | | [optional] -**_Double** | **double?** | | [optional] -**_String** | **string** | | [optional] -**_Byte** | **byte[]** | | +**Float** | **float?** | | [optional] +**Double** | **double?** | | [optional] +**String** | **string** | | [optional] +**Byte** | **byte[]** | | **Binary** | **byte[]** | | [optional] **Date** | **DateTime?** | | **DateTime** | **DateTime?** | | [optional] diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Model200Response.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Model200Response.md index cfaddb67027e..62db21288f2b 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Model200Response.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Model200Response.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **int?** | | [optional] -**_Class** | **string** | | [optional] +**Class** | **string** | | [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/SwaggerClientWithPropertyChanged/docs/ModelClient.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/ModelClient.md index 9ecdc0e11410..c3817230640d 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/ModelClient.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/ModelClient.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Client** | **string** | | [optional] +**__Client** | **string** | | [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/SwaggerClientWithPropertyChanged/docs/Return.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Return.md new file mode 100644 index 000000000000..9a9559907c14 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Return.md @@ -0,0 +1,9 @@ +# IO.Swagger.Model.Return +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_Return** | **int?** | | [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/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ReturnTests.cs new file mode 100644 index 000000000000..ec2a68a5fbb5 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ReturnTests.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Return + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class ReturnTests + { + // TODO uncomment below to declare an instance variable for Return + //private Return instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Return + //instance = new Return(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Return + /// + [Test] + public void ReturnInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Return + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Return"); + } + + + /// + /// Test the property '_Return' + /// + [Test] + public void _ReturnTest() + { + // TODO unit test for the property '_Return' + } + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ClassModel.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ClassModel.cs index e45f78059b2f..f52476f7b29b 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ClassModel.cs @@ -36,17 +36,17 @@ public partial class ClassModel : IEquatable, IValidatableObject /// /// Initializes a new instance of the class. /// - /// _Class. - public ClassModel(string _Class = default(string)) + /// Class. + public ClassModel(string Class = default(string)) { - this._Class = _Class; + this.Class = Class; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="_class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -56,7 +56,7 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class ClassModel {\n"); - sb.Append(" _Class: ").Append(_Class).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -92,9 +92,9 @@ public bool Equals(ClassModel input) return ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -107,8 +107,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/FormatTest.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/FormatTest.cs index 2671ccea2d03..c92aed7f3491 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/FormatTest.cs @@ -45,16 +45,16 @@ public partial class FormatTest : IEquatable, IValidatableObject /// Int32. /// Int64. /// Number (required). - /// _Float. - /// _Double. - /// _String. - /// _Byte (required). + /// Float. + /// Double. + /// String. + /// Byte (required). /// Binary. /// Date (required). /// DateTime. /// Uuid. /// Password (required). - public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long? Int64 = default(long?), decimal? Number = default(decimal?), float? _Float = default(float?), double? _Double = default(double?), string _String = default(string), byte[] _Byte = default(byte[]), byte[] Binary = default(byte[]), DateTime? Date = default(DateTime?), DateTime? DateTime = default(DateTime?), Guid? Uuid = default(Guid?), string Password = default(string)) + public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long? Int64 = default(long?), decimal? Number = default(decimal?), float? Float = default(float?), double? Double = default(double?), string String = default(string), byte[] Byte = default(byte[]), byte[] Binary = default(byte[]), DateTime? Date = default(DateTime?), DateTime? DateTime = default(DateTime?), Guid? Uuid = default(Guid?), string Password = default(string)) { // to ensure "Number" is required (not null) if (Number == null) @@ -65,14 +65,14 @@ public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long { this.Number = Number; } - // to ensure "_Byte" is required (not null) - if (_Byte == null) + // to ensure "Byte" is required (not null) + if (Byte == null) { - throw new InvalidDataException("_Byte is a required property for FormatTest and cannot be null"); + throw new InvalidDataException("Byte is a required property for FormatTest and cannot be null"); } else { - this._Byte = _Byte; + this.Byte = Byte; } // to ensure "Date" is required (not null) if (Date == null) @@ -95,9 +95,9 @@ public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long this.Integer = Integer; this.Int32 = Int32; this.Int64 = Int64; - this._Float = _Float; - this._Double = _Double; - this._String = _String; + this.Float = Float; + this.Double = Double; + this.String = String; this.Binary = Binary; this.DateTime = DateTime; this.Uuid = Uuid; @@ -128,28 +128,28 @@ public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long public decimal? Number { get; set; } /// - /// Gets or Sets _Float + /// Gets or Sets Float /// [DataMember(Name="float", EmitDefaultValue=false)] - public float? _Float { get; set; } + public float? Float { get; set; } /// - /// Gets or Sets _Double + /// Gets or Sets Double /// [DataMember(Name="double", EmitDefaultValue=false)] - public double? _Double { get; set; } + public double? Double { get; set; } /// - /// Gets or Sets _String + /// Gets or Sets String /// [DataMember(Name="string", EmitDefaultValue=false)] - public string _String { get; set; } + public string String { get; set; } /// - /// Gets or Sets _Byte + /// Gets or Sets Byte /// [DataMember(Name="byte", EmitDefaultValue=false)] - public byte[] _Byte { get; set; } + public byte[] Byte { get; set; } /// /// Gets or Sets Binary @@ -194,10 +194,10 @@ public override string ToString() sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); - sb.Append(" _Float: ").Append(_Float).Append("\n"); - sb.Append(" _Double: ").Append(_Double).Append("\n"); - sb.Append(" _String: ").Append(_String).Append("\n"); - sb.Append(" _Byte: ").Append(_Byte).Append("\n"); + sb.Append(" Float: ").Append(Float).Append("\n"); + sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" Byte: ").Append(Byte).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); @@ -258,24 +258,24 @@ public bool Equals(FormatTest input) this.Number.Equals(input.Number)) ) && ( - this._Float == input._Float || - (this._Float != null && - this._Float.Equals(input._Float)) + this.Float == input.Float || + (this.Float != null && + this.Float.Equals(input.Float)) ) && ( - this._Double == input._Double || - (this._Double != null && - this._Double.Equals(input._Double)) + this.Double == input.Double || + (this.Double != null && + this.Double.Equals(input.Double)) ) && ( - this._String == input._String || - (this._String != null && - this._String.Equals(input._String)) + this.String == input.String || + (this.String != null && + this.String.Equals(input.String)) ) && ( - this._Byte == input._Byte || - (this._Byte != null && - this._Byte.Equals(input._Byte)) + this.Byte == input.Byte || + (this.Byte != null && + this.Byte.Equals(input.Byte)) ) && ( this.Binary == input.Binary || @@ -321,14 +321,14 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.Int64.GetHashCode(); if (this.Number != null) hashCode = hashCode * 59 + this.Number.GetHashCode(); - if (this._Float != null) - hashCode = hashCode * 59 + this._Float.GetHashCode(); - if (this._Double != null) - hashCode = hashCode * 59 + this._Double.GetHashCode(); - if (this._String != null) - hashCode = hashCode * 59 + this._String.GetHashCode(); - if (this._Byte != null) - hashCode = hashCode * 59 + this._Byte.GetHashCode(); + if (this.Float != null) + hashCode = hashCode * 59 + this.Float.GetHashCode(); + if (this.Double != null) + hashCode = hashCode * 59 + this.Double.GetHashCode(); + if (this.String != null) + hashCode = hashCode * 59 + this.String.GetHashCode(); + if (this.Byte != null) + hashCode = hashCode * 59 + this.Byte.GetHashCode(); if (this.Binary != null) hashCode = hashCode * 59 + this.Binary.GetHashCode(); if (this.Date != null) @@ -406,35 +406,35 @@ IEnumerable IValidatable yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } - // _Float (float?) maximum - if(this._Float > (float?)987.6) + // Float (float?) maximum + if(this.Float > (float?)987.6) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Float, must be a value less than or equal to 987.6.", new [] { "_Float" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } - // _Float (float?) minimum - if(this._Float < (float?)54.3) + // Float (float?) minimum + if(this.Float < (float?)54.3) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Float, must be a value greater than or equal to 54.3.", new [] { "_Float" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } - // _Double (double?) maximum - if(this._Double > (double?)123.4) + // Double (double?) maximum + if(this.Double > (double?)123.4) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Double, must be a value less than or equal to 123.4.", new [] { "_Double" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } - // _Double (double?) minimum - if(this._Double < (double?)67.8) + // Double (double?) minimum + if(this.Double < (double?)67.8) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Double, must be a value greater than or equal to 67.8.", new [] { "_Double" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } - // _String (string) pattern - Regex regex_String = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); - if (false == regex_String.Match(this._String).Success) + // String (string) pattern + Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + if (false == regexString.Match(this.String).Success) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _String, must match a pattern of " + regex_String, new [] { "_String" }); + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" }); } // Password (string) maxLength diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Model200Response.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Model200Response.cs index 5e61f28fec2e..5503837c0643 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Model200Response.cs @@ -37,11 +37,11 @@ public partial class Model200Response : IEquatable, IValidata /// Initializes a new instance of the class. /// /// Name. - /// _Class. - public Model200Response(int? Name = default(int?), string _Class = default(string)) + /// Class. + public Model200Response(int? Name = default(int?), string Class = default(string)) { this.Name = Name; - this._Class = _Class; + this.Class = Class; } /// @@ -51,10 +51,10 @@ public Model200Response(int? Name = default(int?), string _Class = default(strin public int? Name { get; set; } /// - /// Gets or Sets _Class + /// Gets or Sets Class /// [DataMember(Name="class", EmitDefaultValue=false)] - public string _Class { get; set; } + public string Class { get; set; } /// /// Returns the string presentation of the object @@ -65,7 +65,7 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class Model200Response {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" _Class: ").Append(_Class).Append("\n"); + sb.Append(" Class: ").Append(Class).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -106,9 +106,9 @@ public bool Equals(Model200Response input) this.Name.Equals(input.Name)) ) && ( - this._Class == input._Class || - (this._Class != null && - this._Class.Equals(input._Class)) + this.Class == input.Class || + (this.Class != null && + this.Class.Equals(input.Class)) ); } @@ -123,8 +123,8 @@ public override int GetHashCode() int hashCode = 41; if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this._Class != null) - hashCode = hashCode * 59 + this._Class.GetHashCode(); + if (this.Class != null) + hashCode = hashCode * 59 + this.Class.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ModelClient.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ModelClient.cs index bd959a8a26c9..1fe5ee1c1be2 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ModelClient.cs @@ -36,17 +36,17 @@ public partial class ModelClient : IEquatable, IValidatableObject /// /// Initializes a new instance of the class. /// - /// _Client. - public ModelClient(string _Client = default(string)) + /// __Client. + public ModelClient(string __Client = default(string)) { - this._Client = _Client; + this.__Client = __Client; } /// - /// Gets or Sets _Client + /// Gets or Sets __Client /// [DataMember(Name="client", EmitDefaultValue=false)] - public string _Client { get; set; } + public string __Client { get; set; } /// /// Returns the string presentation of the object @@ -56,7 +56,7 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class ModelClient {\n"); - sb.Append(" _Client: ").Append(_Client).Append("\n"); + sb.Append(" __Client: ").Append(__Client).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -92,9 +92,9 @@ public bool Equals(ModelClient input) return ( - this._Client == input._Client || - (this._Client != null && - this._Client.Equals(input._Client)) + this.__Client == input.__Client || + (this.__Client != null && + this.__Client.Equals(input.__Client)) ); } @@ -107,8 +107,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this._Client != null) - hashCode = hashCode * 59 + this._Client.GetHashCode(); + if (this.__Client != null) + hashCode = hashCode * 59 + this.__Client.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Return.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Return.cs new file mode 100644 index 000000000000..c8b264faba1d --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Return.cs @@ -0,0 +1,147 @@ +/* + * Swagger Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using PropertyChanged; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// Model for testing reserved words + /// + [DataContract] + [ImplementPropertyChanged] + public partial class Return : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// _Return. + public Return(int? _Return = default(int?)) + { + this._Return = _Return; + } + + /// + /// Gets or Sets _Return + /// + [DataMember(Name="return", EmitDefaultValue=false)] + public int? _Return { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Return {\n"); + sb.Append(" _Return: ").Append(_Return).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Return); + } + + /// + /// Returns true if Return instances are equal + /// + /// Instance of Return to be compared + /// Boolean + public bool Equals(Return input) + { + if (input == null) + return false; + + return + ( + this._Return == input._Return || + (this._Return != null && + this._Return.Equals(input._Return)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this._Return != null) + hashCode = hashCode * 59 + this._Return.GetHashCode(); + return hashCode; + } + } + + /// + /// Property changed event handler + /// + public event PropertyChangedEventHandler PropertyChanged; + + /// + /// Trigger when a property changed + /// + /// Property Name + public virtual void OnPropertyChanged(string propertyName) + { + // NOTE: property changed is handled via "code weaving" using Fody. + // Properties with setters are modified at compile time to notify of changes. + var propertyChanged = PropertyChanged; + if (propertyChanged != null) + { + propertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +}