[csharp] enum suffix changes enumValueNameSuffix to enumValueSuffix (#4927)

* [csharp] Change enum value suffix name

'enumValueNameSuffix' and 'enumNameSuffix' were introduced in a recent
commit. This changes 'enumValueNameSuffix' to 'enumValueSuffix' to
better differentiate between the two options. This also adds a caveat to
the default description which explains that this flexibility may cause
issues when used by client generator.

* [csharp][aspnetcore] Regenerate samples
This commit is contained in:
Jim Schubert 2020-01-05 16:18:19 -05:00 committed by GitHub
parent 9b893ef3c1
commit ec1e9a4c9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
44 changed files with 1965 additions and 50 deletions

View File

@ -28,7 +28,7 @@ sidebar_label: aspnetcore
|newtonsoftVersion|Version for Microsoft.AspNetCore.Mvc.NewtonsoftJson for ASP.NET Core 3.0+| |3.0.0-preview5-19227-01|
|useDefaultRouting|Use default routing for the ASP.NET Core version. For 3.0 turn off default because it is not yet supported.| |true|
|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum|
|enumValueNameSuffix|Suffix that will be appended to all enum value names.| |Enum|
|enumValueSuffix|Suffix that will be appended to all enum values.| |Enum|
|classModifier|Class Modifier can be empty, abstract| ||
|operationModifier|Operation Modifier can be virtual, abstract or partial| |virtual|
|buildTarget|Target to build an application or library| |program|

View File

@ -227,8 +227,8 @@ public class CodegenConstants {
public static final String ENUM_NAME_SUFFIX = "enumNameSuffix";
public static final String ENUM_NAME_SUFFIX_DESC = "Suffix that will be appended to all enum names.";
public static final String ENUM_VALUE_NAME_SUFFIX = "enumValueNameSuffix";
public static final String ENUM_VALUE_NAME_SUFFIX_DESC = "Suffix that will be appended to all enum value names.";
public static final String ENUM_VALUE_SUFFIX = "enumValueSuffix";
public static final String ENUM_VALUE_SUFFIX_DESC = "Suffix that will be appended to all enum values. Note: For clients this may impact serialization and deserialization of enum values.";
public static final String GIT_HOST = "gitHost";
public static final String GIT_HOST_DESC = "Git host, e.g. gitlab.com.";

View File

@ -63,7 +63,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
protected String interfacePrefix = "I";
protected String enumNameSuffix = "Enum";
protected String enumValueNameSuffix = "Enum";
protected String enumValueSuffix = "Enum";
protected String sourceFolder = "src";
@ -367,8 +367,8 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
setEnumNameSuffix(additionalProperties.get(CodegenConstants.ENUM_NAME_SUFFIX).toString());
}
if (additionalProperties().containsKey(CodegenConstants.ENUM_VALUE_NAME_SUFFIX)) {
setEnumValueNameSuffix(additionalProperties.get(CodegenConstants.ENUM_VALUE_NAME_SUFFIX).toString());
if (additionalProperties().containsKey(CodegenConstants.ENUM_VALUE_SUFFIX)) {
setEnumValueSuffix(additionalProperties.get(CodegenConstants.ENUM_VALUE_SUFFIX).toString());
}
// This either updates additionalProperties with the above fixes, or sets the default if the option was not specified.
@ -1017,8 +1017,8 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
this.enumNameSuffix = enumNameSuffix;
}
public void setEnumValueNameSuffix(final String enumValueNameSuffix) {
this.enumValueNameSuffix = enumValueNameSuffix;
public void setEnumValueSuffix(final String enumValueSuffix) {
this.enumValueSuffix = enumValueSuffix;
}
public boolean isSupportNullable() {
@ -1058,7 +1058,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
enumName = enumName.replaceFirst("^_", "");
enumName = enumName.replaceFirst("_$", "");
enumName = camelize(enumName) + this.enumValueNameSuffix;
enumName = camelize(enumName) + this.enumValueSuffix;
if (enumName.matches("\\d.*")) { // starts with number
return "_" + enumName;

View File

@ -214,9 +214,9 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen {
CodegenConstants.ENUM_NAME_SUFFIX_DESC,
enumNameSuffix);
addOption(CodegenConstants.ENUM_VALUE_NAME_SUFFIX,
CodegenConstants.ENUM_VALUE_NAME_SUFFIX_DESC,
enumValueNameSuffix);
addOption(CodegenConstants.ENUM_VALUE_SUFFIX,
"Suffix that will be appended to all enum values.",
enumValueSuffix);
classModifier.addEnum("", "Keep class default with no modifier");
classModifier.addEnum("abstract", "Make class abstract");

View File

@ -16,6 +16,7 @@
*/
package org.openapitools.codegen.csharp;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
@ -30,7 +31,6 @@ import org.testng.annotations.Test;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class CsharpModelEnumTest {
@ -93,6 +93,25 @@ public class CsharpModelEnumTest {
*/
}
@Test(description = "use custom suffixes for enums")
public void useCustomEnumSuffixes() {
final AspNetCoreServerCodegen codegen = new AspNetCoreServerCodegen();
codegen.setEnumNameSuffix("EnumName");
codegen.setEnumValueSuffix("EnumValue");
OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml");
codegen.setOpenAPI(openAPI);
final Schema petSchema = openAPI.getComponents().getSchemas().get("Pet");
final CodegenModel cm = codegen.fromModel("Pet", petSchema);
final CodegenProperty statusProperty = cm.vars.get(5);
Assert.assertEquals(statusProperty.name, "Status");
Assert.assertTrue(statusProperty.isEnum);
Assert.assertEquals(statusProperty.datatypeWithEnum, "StatusEnumName");
Assert.assertEquals(codegen.toEnumVarName("Aaaa", ""), "AaaaEnumValue");
}
@Test(description = "use default suffixes for enums")
public void useDefaultEnumSuffixes() {
final AspNetCoreServerCodegen codegen = new AspNetCoreServerCodegen();
@ -110,11 +129,11 @@ public class CsharpModelEnumTest {
Assert.assertEquals(codegen.toEnumVarName("Aaaa", ""), "AaaaEnum");
}
@Test(description = "use custom suffixes for enums")
public void useCustomEnumSuffixes() {
@Test(description = "support empty suffixes for enums")
public void useEmptyEnumSuffixes() {
final AspNetCoreServerCodegen codegen = new AspNetCoreServerCodegen();
codegen.setEnumNameSuffix("EnumName");
codegen.setEnumValueNameSuffix("EnumValue");
codegen.setEnumNameSuffix("");
codegen.setEnumValueSuffix("");
OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml");
codegen.setOpenAPI(openAPI);
@ -124,8 +143,9 @@ public class CsharpModelEnumTest {
final CodegenProperty statusProperty = cm.vars.get(5);
Assert.assertEquals(statusProperty.name, "Status");
Assert.assertTrue(statusProperty.isEnum);
Assert.assertEquals(statusProperty.datatypeWithEnum, "StatusEnumName");
Assert.assertEquals(statusProperty.datatypeWithEnum, "Status");
Assert.assertEquals(codegen.toEnumVarName("Aaaa", ""), "AaaaEnumValue");
Assert.assertEquals(codegen.toEnumVarName("Aaaa", ""), "Aaaa");
}
}

View File

@ -1 +1 @@
4.2.0-SNAPSHOT
4.2.3-SNAPSHOT

View File

@ -159,6 +159,8 @@ Class | Method | HTTP request | Description
- [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
- [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [Model.ArrayTest](docs/ArrayTest.md)
- [Model.BigCat](docs/BigCat.md)
- [Model.BigCatAllOf](docs/BigCatAllOf.md)
- [Model.Capitalization](docs/Capitalization.md)
- [Model.Cat](docs/Cat.md)
- [Model.CatAllOf](docs/CatAllOf.md)

View File

@ -0,0 +1,14 @@
# Org.OpenAPITools.Model.BigCat
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Declawed** | **bool** | | [optional]
**Kind** | **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)

View File

@ -0,0 +1,13 @@
# Org.OpenAPITools.Model.BigCatAllOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Kind** | **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)

View File

@ -0,0 +1,79 @@
/*
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using NUnit.Framework;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;
namespace Org.OpenAPITools.Test
{
/// <summary>
/// Class for testing BigCatAllOf
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class BigCatAllOfTests
{
// TODO uncomment below to declare an instance variable for BigCatAllOf
//private BigCatAllOf instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of BigCatAllOf
//instance = new BigCatAllOf();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of BigCatAllOf
/// </summary>
[Test]
public void BigCatAllOfInstanceTest()
{
// TODO uncomment below to test "IsInstanceOf" BigCatAllOf
//Assert.IsInstanceOf(typeof(BigCatAllOf), instance);
}
/// <summary>
/// Test the property 'Kind'
/// </summary>
[Test]
public void KindTest()
{
// TODO unit test for the property 'Kind'
}
}
}

View File

@ -0,0 +1,79 @@
/*
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using NUnit.Framework;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;
namespace Org.OpenAPITools.Test
{
/// <summary>
/// Class for testing BigCat
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class BigCatTests
{
// TODO uncomment below to declare an instance variable for BigCat
//private BigCat instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of BigCat
//instance = new BigCat();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of BigCat
/// </summary>
[Test]
public void BigCatInstanceTest()
{
// TODO uncomment below to test "IsInstanceOf" BigCat
//Assert.IsInstanceOf(typeof(BigCat), instance);
}
/// <summary>
/// Test the property 'Kind'
/// </summary>
[Test]
public void KindTest()
{
// TODO unit test for the property 'Kind'
}
}
}

View File

@ -32,6 +32,7 @@ namespace Org.OpenAPITools.Model
[JsonConverter(typeof(JsonSubtypes), "ClassName")]
[JsonSubtypes.KnownSubType(typeof(Dog), "Dog")]
[JsonSubtypes.KnownSubType(typeof(Cat), "Cat")]
[JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")]
public partial class Animal : IEquatable<Animal>
{
/// <summary>

View File

@ -0,0 +1,153 @@
/*
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// BigCat
/// </summary>
[DataContract]
public partial class BigCat : Cat, IEquatable<BigCat>
{
/// <summary>
/// Defines Kind
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum KindEnum
{
/// <summary>
/// Enum Lions for value: lions
/// </summary>
[EnumMember(Value = "lions")]
Lions = 1,
/// <summary>
/// Enum Tigers for value: tigers
/// </summary>
[EnumMember(Value = "tigers")]
Tigers = 2,
/// <summary>
/// Enum Leopards for value: leopards
/// </summary>
[EnumMember(Value = "leopards")]
Leopards = 3,
/// <summary>
/// Enum Jaguars for value: jaguars
/// </summary>
[EnumMember(Value = "jaguars")]
Jaguars = 4
}
/// <summary>
/// Gets or Sets Kind
/// </summary>
[DataMember(Name="kind", EmitDefaultValue=false)]
public KindEnum? Kind { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="BigCat" /> class.
/// </summary>
[JsonConstructorAttribute]
protected BigCat() { }
/// <summary>
/// Initializes a new instance of the <see cref="BigCat" /> class.
/// </summary>
/// <param name="kind">kind.</param>
public BigCat(KindEnum? kind = default(KindEnum?), string className = default(string), string color = "red", bool declawed = default(bool)) : base(declawed)
{
this.Kind = kind;
}
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class BigCat {\n");
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n");
sb.Append(" Kind: ").Append(Kind).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public override string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as BigCat);
}
/// <summary>
/// Returns true if BigCat instances are equal
/// </summary>
/// <param name="input">Instance of BigCat to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(BigCat input)
{
if (input == null)
return false;
return base.Equals(input) &&
(
this.Kind == input.Kind ||
(this.Kind != null &&
this.Kind.Equals(input.Kind))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = base.GetHashCode();
if (this.Kind != null)
hashCode = hashCode * 59 + this.Kind.GetHashCode();
return hashCode;
}
}
}
}

View File

@ -0,0 +1,147 @@
/*
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// BigCatAllOf
/// </summary>
[DataContract]
public partial class BigCatAllOf : IEquatable<BigCatAllOf>
{
/// <summary>
/// Defines Kind
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum KindEnum
{
/// <summary>
/// Enum Lions for value: lions
/// </summary>
[EnumMember(Value = "lions")]
Lions = 1,
/// <summary>
/// Enum Tigers for value: tigers
/// </summary>
[EnumMember(Value = "tigers")]
Tigers = 2,
/// <summary>
/// Enum Leopards for value: leopards
/// </summary>
[EnumMember(Value = "leopards")]
Leopards = 3,
/// <summary>
/// Enum Jaguars for value: jaguars
/// </summary>
[EnumMember(Value = "jaguars")]
Jaguars = 4
}
/// <summary>
/// Gets or Sets Kind
/// </summary>
[DataMember(Name="kind", EmitDefaultValue=false)]
public KindEnum? Kind { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="BigCatAllOf" /> class.
/// </summary>
/// <param name="kind">kind.</param>
public BigCatAllOf(KindEnum? kind = default(KindEnum?))
{
this.Kind = kind;
}
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class BigCatAllOf {\n");
sb.Append(" Kind: ").Append(Kind).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as BigCatAllOf);
}
/// <summary>
/// Returns true if BigCatAllOf instances are equal
/// </summary>
/// <param name="input">Instance of BigCatAllOf to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(BigCatAllOf input)
{
if (input == null)
return false;
return
(
this.Kind == input.Kind ||
(this.Kind != null &&
this.Kind.Equals(input.Kind))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.Kind != null)
hashCode = hashCode * 59 + this.Kind.GetHashCode();
return hashCode;
}
}
}
}

View File

@ -1 +1 @@
4.2.0-SNAPSHOT
4.2.3-SNAPSHOT

View File

@ -159,6 +159,8 @@ Class | Method | HTTP request | Description
- [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
- [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [Model.ArrayTest](docs/ArrayTest.md)
- [Model.BigCat](docs/BigCat.md)
- [Model.BigCatAllOf](docs/BigCatAllOf.md)
- [Model.Capitalization](docs/Capitalization.md)
- [Model.Cat](docs/Cat.md)
- [Model.CatAllOf](docs/CatAllOf.md)

View File

@ -0,0 +1,14 @@
# Org.OpenAPITools.Model.BigCat
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Declawed** | **bool** | | [optional]
**Kind** | **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)

View File

@ -0,0 +1,13 @@
# Org.OpenAPITools.Model.BigCatAllOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Kind** | **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)

View File

@ -0,0 +1,79 @@
/*
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using NUnit.Framework;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;
namespace Org.OpenAPITools.Test
{
/// <summary>
/// Class for testing BigCatAllOf
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class BigCatAllOfTests
{
// TODO uncomment below to declare an instance variable for BigCatAllOf
//private BigCatAllOf instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of BigCatAllOf
//instance = new BigCatAllOf();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of BigCatAllOf
/// </summary>
[Test]
public void BigCatAllOfInstanceTest()
{
// TODO uncomment below to test "IsInstanceOf" BigCatAllOf
//Assert.IsInstanceOf(typeof(BigCatAllOf), instance);
}
/// <summary>
/// Test the property 'Kind'
/// </summary>
[Test]
public void KindTest()
{
// TODO unit test for the property 'Kind'
}
}
}

View File

@ -0,0 +1,79 @@
/*
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using NUnit.Framework;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;
namespace Org.OpenAPITools.Test
{
/// <summary>
/// Class for testing BigCat
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class BigCatTests
{
// TODO uncomment below to declare an instance variable for BigCat
//private BigCat instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of BigCat
//instance = new BigCat();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of BigCat
/// </summary>
[Test]
public void BigCatInstanceTest()
{
// TODO uncomment below to test "IsInstanceOf" BigCat
//Assert.IsInstanceOf(typeof(BigCat), instance);
}
/// <summary>
/// Test the property 'Kind'
/// </summary>
[Test]
public void KindTest()
{
// TODO unit test for the property 'Kind'
}
}
}

View File

@ -32,6 +32,7 @@ namespace Org.OpenAPITools.Model
[JsonConverter(typeof(JsonSubtypes), "ClassName")]
[JsonSubtypes.KnownSubType(typeof(Dog), "Dog")]
[JsonSubtypes.KnownSubType(typeof(Cat), "Cat")]
[JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")]
public partial class Animal : IEquatable<Animal>, IValidatableObject
{
/// <summary>

View File

@ -0,0 +1,163 @@
/*
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// BigCat
/// </summary>
[DataContract]
public partial class BigCat : Cat, IEquatable<BigCat>, IValidatableObject
{
/// <summary>
/// Defines Kind
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum KindEnum
{
/// <summary>
/// Enum Lions for value: lions
/// </summary>
[EnumMember(Value = "lions")]
Lions = 1,
/// <summary>
/// Enum Tigers for value: tigers
/// </summary>
[EnumMember(Value = "tigers")]
Tigers = 2,
/// <summary>
/// Enum Leopards for value: leopards
/// </summary>
[EnumMember(Value = "leopards")]
Leopards = 3,
/// <summary>
/// Enum Jaguars for value: jaguars
/// </summary>
[EnumMember(Value = "jaguars")]
Jaguars = 4
}
/// <summary>
/// Gets or Sets Kind
/// </summary>
[DataMember(Name="kind", EmitDefaultValue=false)]
public KindEnum? Kind { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="BigCat" /> class.
/// </summary>
[JsonConstructorAttribute]
protected BigCat() { }
/// <summary>
/// Initializes a new instance of the <see cref="BigCat" /> class.
/// </summary>
/// <param name="kind">kind.</param>
public BigCat(KindEnum? kind = default(KindEnum?), string className = default(string), string color = "red", bool declawed = default(bool)) : base(declawed)
{
this.Kind = kind;
}
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class BigCat {\n");
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n");
sb.Append(" Kind: ").Append(Kind).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public override string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as BigCat);
}
/// <summary>
/// Returns true if BigCat instances are equal
/// </summary>
/// <param name="input">Instance of BigCat to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(BigCat input)
{
if (input == null)
return false;
return base.Equals(input) &&
(
this.Kind == input.Kind ||
(this.Kind != null &&
this.Kind.Equals(input.Kind))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = base.GetHashCode();
if (this.Kind != null)
hashCode = hashCode * 59 + this.Kind.GetHashCode();
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
foreach(var x in base.BaseValidate(validationContext)) yield return x;
yield break;
}
}
}

View File

@ -0,0 +1,156 @@
/*
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// BigCatAllOf
/// </summary>
[DataContract]
public partial class BigCatAllOf : IEquatable<BigCatAllOf>, IValidatableObject
{
/// <summary>
/// Defines Kind
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum KindEnum
{
/// <summary>
/// Enum Lions for value: lions
/// </summary>
[EnumMember(Value = "lions")]
Lions = 1,
/// <summary>
/// Enum Tigers for value: tigers
/// </summary>
[EnumMember(Value = "tigers")]
Tigers = 2,
/// <summary>
/// Enum Leopards for value: leopards
/// </summary>
[EnumMember(Value = "leopards")]
Leopards = 3,
/// <summary>
/// Enum Jaguars for value: jaguars
/// </summary>
[EnumMember(Value = "jaguars")]
Jaguars = 4
}
/// <summary>
/// Gets or Sets Kind
/// </summary>
[DataMember(Name="kind", EmitDefaultValue=false)]
public KindEnum? Kind { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="BigCatAllOf" /> class.
/// </summary>
/// <param name="kind">kind.</param>
public BigCatAllOf(KindEnum? kind = default(KindEnum?))
{
this.Kind = kind;
}
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class BigCatAllOf {\n");
sb.Append(" Kind: ").Append(Kind).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as BigCatAllOf);
}
/// <summary>
/// Returns true if BigCatAllOf instances are equal
/// </summary>
/// <param name="input">Instance of BigCatAllOf to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(BigCatAllOf input)
{
if (input == null)
return false;
return
(
this.Kind == input.Kind ||
(this.Kind != null &&
this.Kind.Equals(input.Kind))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.Kind != null)
hashCode = hashCode * 59 + this.Kind.GetHashCode();
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -122,6 +122,16 @@ namespace Org.OpenAPITools.Model
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
return this.BaseValidate(validationContext);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
protected IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> BaseValidate(ValidationContext validationContext)
{
foreach(var x in base.BaseValidate(validationContext)) yield return x;
yield break;

View File

@ -1 +1 @@
4.2.0-SNAPSHOT
4.2.3-SNAPSHOT

View File

@ -135,6 +135,8 @@ Class | Method | HTTP request | Description
- [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
- [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [Model.ArrayTest](docs/ArrayTest.md)
- [Model.BigCat](docs/BigCat.md)
- [Model.BigCatAllOf](docs/BigCatAllOf.md)
- [Model.Capitalization](docs/Capitalization.md)
- [Model.Cat](docs/Cat.md)
- [Model.CatAllOf](docs/CatAllOf.md)

View File

@ -0,0 +1,14 @@
# Org.OpenAPITools.Model.BigCat
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Declawed** | **bool** | | [optional]
**Kind** | **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)

View File

@ -0,0 +1,13 @@
# Org.OpenAPITools.Model.BigCatAllOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Kind** | **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)

View File

@ -30,6 +30,7 @@ namespace Org.OpenAPITools.Model
[JsonConverter(typeof(JsonSubtypes), "ClassName")]
[JsonSubtypes.KnownSubType(typeof(Dog), "Dog")]
[JsonSubtypes.KnownSubType(typeof(Cat), "Cat")]
[JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")]
public partial class Animal : IEquatable<Animal>
{
/// <summary>

View File

@ -0,0 +1,150 @@
/*
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// BigCat
/// </summary>
[DataContract]
public partial class BigCat : Cat, IEquatable<BigCat>
{
/// <summary>
/// Defines Kind
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum KindEnum
{
/// <summary>
/// Enum Lions for value: lions
/// </summary>
[EnumMember(Value = "lions")]
Lions = 1,
/// <summary>
/// Enum Tigers for value: tigers
/// </summary>
[EnumMember(Value = "tigers")]
Tigers = 2,
/// <summary>
/// Enum Leopards for value: leopards
/// </summary>
[EnumMember(Value = "leopards")]
Leopards = 3,
/// <summary>
/// Enum Jaguars for value: jaguars
/// </summary>
[EnumMember(Value = "jaguars")]
Jaguars = 4
}
/// <summary>
/// Gets or Sets Kind
/// </summary>
[DataMember(Name="kind", EmitDefaultValue=false)]
public KindEnum? Kind { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="BigCat" /> class.
/// </summary>
[JsonConstructorAttribute]
protected BigCat() { }
/// <summary>
/// Initializes a new instance of the <see cref="BigCat" /> class.
/// </summary>
/// <param name="kind">kind.</param>
public BigCat(KindEnum? kind = default(KindEnum?), string className = default(string), string color = "red", bool declawed = default(bool)) : base(declawed)
{
this.Kind = kind;
}
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class BigCat {\n");
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n");
sb.Append(" Kind: ").Append(Kind).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public override string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as BigCat);
}
/// <summary>
/// Returns true if BigCat instances are equal
/// </summary>
/// <param name="input">Instance of BigCat to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(BigCat input)
{
if (input == null)
return false;
return base.Equals(input) &&
(
this.Kind == input.Kind ||
(this.Kind != null &&
this.Kind.Equals(input.Kind))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = base.GetHashCode();
if (this.Kind != null)
hashCode = hashCode * 59 + this.Kind.GetHashCode();
return hashCode;
}
}
}
}

View File

@ -0,0 +1,144 @@
/*
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// BigCatAllOf
/// </summary>
[DataContract]
public partial class BigCatAllOf : IEquatable<BigCatAllOf>
{
/// <summary>
/// Defines Kind
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum KindEnum
{
/// <summary>
/// Enum Lions for value: lions
/// </summary>
[EnumMember(Value = "lions")]
Lions = 1,
/// <summary>
/// Enum Tigers for value: tigers
/// </summary>
[EnumMember(Value = "tigers")]
Tigers = 2,
/// <summary>
/// Enum Leopards for value: leopards
/// </summary>
[EnumMember(Value = "leopards")]
Leopards = 3,
/// <summary>
/// Enum Jaguars for value: jaguars
/// </summary>
[EnumMember(Value = "jaguars")]
Jaguars = 4
}
/// <summary>
/// Gets or Sets Kind
/// </summary>
[DataMember(Name="kind", EmitDefaultValue=false)]
public KindEnum? Kind { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="BigCatAllOf" /> class.
/// </summary>
/// <param name="kind">kind.</param>
public BigCatAllOf(KindEnum? kind = default(KindEnum?))
{
this.Kind = kind;
}
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class BigCatAllOf {\n");
sb.Append(" Kind: ").Append(Kind).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as BigCatAllOf);
}
/// <summary>
/// Returns true if BigCatAllOf instances are equal
/// </summary>
/// <param name="input">Instance of BigCatAllOf to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(BigCatAllOf input)
{
if (input == null)
return false;
return
(
this.Kind == input.Kind ||
(this.Kind != null &&
this.Kind.Equals(input.Kind))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.Kind != null)
hashCode = hashCode * 59 + this.Kind.GetHashCode();
return hashCode;
}
}
}
}

View File

@ -159,6 +159,8 @@ Class | Method | HTTP request | Description
- [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
- [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [Model.ArrayTest](docs/ArrayTest.md)
- [Model.BigCat](docs/BigCat.md)
- [Model.BigCatAllOf](docs/BigCatAllOf.md)
- [Model.Capitalization](docs/Capitalization.md)
- [Model.Cat](docs/Cat.md)
- [Model.CatAllOf](docs/CatAllOf.md)

View File

@ -0,0 +1,14 @@
# Org.OpenAPITools.Model.BigCat
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Declawed** | **bool** | | [optional]
**Kind** | **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)

View File

@ -0,0 +1,13 @@
# Org.OpenAPITools.Model.BigCatAllOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Kind** | **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)

View File

@ -0,0 +1,79 @@
/*
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using NUnit.Framework;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;
namespace Org.OpenAPITools.Test
{
/// <summary>
/// Class for testing BigCatAllOf
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class BigCatAllOfTests
{
// TODO uncomment below to declare an instance variable for BigCatAllOf
//private BigCatAllOf instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of BigCatAllOf
//instance = new BigCatAllOf();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of BigCatAllOf
/// </summary>
[Test]
public void BigCatAllOfInstanceTest()
{
// TODO uncomment below to test "IsInstanceOf" BigCatAllOf
//Assert.IsInstanceOf(typeof(BigCatAllOf), instance);
}
/// <summary>
/// Test the property 'Kind'
/// </summary>
[Test]
public void KindTest()
{
// TODO unit test for the property 'Kind'
}
}
}

View File

@ -0,0 +1,79 @@
/*
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using NUnit.Framework;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;
namespace Org.OpenAPITools.Test
{
/// <summary>
/// Class for testing BigCat
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class BigCatTests
{
// TODO uncomment below to declare an instance variable for BigCat
//private BigCat instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of BigCat
//instance = new BigCat();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of BigCat
/// </summary>
[Test]
public void BigCatInstanceTest()
{
// TODO uncomment below to test "IsInstanceOf" BigCat
//Assert.IsInstanceOf(typeof(BigCat), instance);
}
/// <summary>
/// Test the property 'Kind'
/// </summary>
[Test]
public void KindTest()
{
// TODO unit test for the property 'Kind'
}
}
}

View File

@ -34,6 +34,7 @@ namespace Org.OpenAPITools.Model
[JsonConverter(typeof(JsonSubtypes), "ClassName")]
[JsonSubtypes.KnownSubType(typeof(Dog), "Dog")]
[JsonSubtypes.KnownSubType(typeof(Cat), "Cat")]
[JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")]
[ImplementPropertyChanged]
public partial class Animal : IEquatable<Animal>, IValidatableObject
{

View File

@ -0,0 +1,186 @@
/*
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// BigCat
/// </summary>
[DataContract]
[ImplementPropertyChanged]
public partial class BigCat : Cat, IEquatable<BigCat>, IValidatableObject
{
/// <summary>
/// Defines Kind
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum KindEnum
{
/// <summary>
/// Enum Lions for value: lions
/// </summary>
[EnumMember(Value = "lions")]
Lions = 1,
/// <summary>
/// Enum Tigers for value: tigers
/// </summary>
[EnumMember(Value = "tigers")]
Tigers = 2,
/// <summary>
/// Enum Leopards for value: leopards
/// </summary>
[EnumMember(Value = "leopards")]
Leopards = 3,
/// <summary>
/// Enum Jaguars for value: jaguars
/// </summary>
[EnumMember(Value = "jaguars")]
Jaguars = 4
}
/// <summary>
/// Gets or Sets Kind
/// </summary>
[DataMember(Name="kind", EmitDefaultValue=true)]
public KindEnum? Kind { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="BigCat" /> class.
/// </summary>
[JsonConstructorAttribute]
protected BigCat() { }
/// <summary>
/// Initializes a new instance of the <see cref="BigCat" /> class.
/// </summary>
/// <param name="kind">kind.</param>
public BigCat(KindEnum? kind = default(KindEnum?), string className = default(string), string color = "red", bool declawed = default(bool)) : base(declawed)
{
this.Kind = kind;
}
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class BigCat {\n");
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n");
sb.Append(" Kind: ").Append(Kind).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public override string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as BigCat);
}
/// <summary>
/// Returns true if BigCat instances are equal
/// </summary>
/// <param name="input">Instance of BigCat to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(BigCat input)
{
if (input == null)
return false;
return base.Equals(input) &&
(
this.Kind == input.Kind ||
(this.Kind != null &&
this.Kind.Equals(input.Kind))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = base.GetHashCode();
if (this.Kind != null)
hashCode = hashCode * 59 + this.Kind.GetHashCode();
return hashCode;
}
}
/// <summary>
/// Property changed event handler
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// Trigger when a property changed
/// </summary>
/// <param name="propertyName">Property Name</param>
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));
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
foreach(var x in base.BaseValidate(validationContext)) yield return x;
yield break;
}
}
}

View File

@ -0,0 +1,179 @@
/*
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://github.com/openapitools/openapi-generator.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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// BigCatAllOf
/// </summary>
[DataContract]
[ImplementPropertyChanged]
public partial class BigCatAllOf : IEquatable<BigCatAllOf>, IValidatableObject
{
/// <summary>
/// Defines Kind
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum KindEnum
{
/// <summary>
/// Enum Lions for value: lions
/// </summary>
[EnumMember(Value = "lions")]
Lions = 1,
/// <summary>
/// Enum Tigers for value: tigers
/// </summary>
[EnumMember(Value = "tigers")]
Tigers = 2,
/// <summary>
/// Enum Leopards for value: leopards
/// </summary>
[EnumMember(Value = "leopards")]
Leopards = 3,
/// <summary>
/// Enum Jaguars for value: jaguars
/// </summary>
[EnumMember(Value = "jaguars")]
Jaguars = 4
}
/// <summary>
/// Gets or Sets Kind
/// </summary>
[DataMember(Name="kind", EmitDefaultValue=true)]
public KindEnum? Kind { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="BigCatAllOf" /> class.
/// </summary>
/// <param name="kind">kind.</param>
public BigCatAllOf(KindEnum? kind = default(KindEnum?))
{
this.Kind = kind;
}
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class BigCatAllOf {\n");
sb.Append(" Kind: ").Append(Kind).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as BigCatAllOf);
}
/// <summary>
/// Returns true if BigCatAllOf instances are equal
/// </summary>
/// <param name="input">Instance of BigCatAllOf to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(BigCatAllOf input)
{
if (input == null)
return false;
return
(
this.Kind == input.Kind ||
(this.Kind != null &&
this.Kind.Equals(input.Kind))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.Kind != null)
hashCode = hashCode * 59 + this.Kind.GetHashCode();
return hashCode;
}
}
/// <summary>
/// Property changed event handler
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// Trigger when a property changed
/// </summary>
/// <param name="propertyName">Property Name</param>
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));
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@ -145,6 +145,16 @@ namespace Org.OpenAPITools.Model
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
return this.BaseValidate(validationContext);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
protected IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> BaseValidate(ValidationContext validationContext)
{
foreach(var x in base.BaseValidate(validationContext)) yield return x;
yield break;

View File

@ -59,36 +59,36 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*PetApi* | [**addPet**](docs//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
*PetApi* | [**deletePet**](docs//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
*PetApi* | [**findPetsByStatus**](docs//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
*PetApi* | [**findPetsByTags**](docs//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
*PetApi* | [**getPetById**](docs//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
*PetApi* | [**updatePet**](docs//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
*PetApi* | [**updatePetWithForm**](docs//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
*PetApi* | [**uploadFile**](docs//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
*StoreApi* | [**deleteOrder**](docs//StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
*StoreApi* | [**getInventory**](docs//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
*StoreApi* | [**getOrderById**](docs//StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
*StoreApi* | [**placeOrder**](docs//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
*UserApi* | [**createUser**](docs//UserApi.md#createuser) | **POST** /user | Create user
*UserApi* | [**createUsersWithArrayInput**](docs//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
*UserApi* | [**createUsersWithListInput**](docs//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
*UserApi* | [**deleteUser**](docs//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
*UserApi* | [**getUserByName**](docs//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
*UserApi* | [**loginUser**](docs//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
*UserApi* | [**logoutUser**](docs//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
*UserApi* | [**updateUser**](docs//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **POST** /user | Create user
*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
## Documentation For Models
- [ApiResponse](docs//ApiResponse.md)
- [Category](docs//Category.md)
- [Order](docs//Order.md)
- [Pet](docs//Pet.md)
- [Tag](docs//Tag.md)
- [User](docs//User.md)
- [ApiResponse](doc//ApiResponse.md)
- [Category](doc//Category.md)
- [Order](doc//Order.md)
- [Pet](doc//Pet.md)
- [Tag](doc//Tag.md)
- [User](doc//User.md)
## Documentation For Authorization

View File

@ -1,6 +1,9 @@
name: openapi
version: 1.0.0
description: OpenAPI API client
authors:
- Author <author@homepage>
homepage: homepage
environment:
sdk: '>=2.0.0 <3.0.0'
dependencies:

View File

@ -1 +1 @@
4.1.3-SNAPSHOT
4.2.3-SNAPSHOT