diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 999209657da4..534f15548d2f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -1790,7 +1790,7 @@ public CodegenModel fromModel(String name, Schema schema) { // parent model final String parentName = ModelUtils.getParentName(composed, allDefinitions); - final List allParents = ModelUtils.getAllParentsName(composed, allDefinitions); + final List allParents = ModelUtils.getAllParentsName(composed, allDefinitions, false); final Schema parent = StringUtils.isBlank(parentName) || allDefinitions == null ? null : allDefinitions.get(parentName); final boolean hasParent = StringUtils.isNotBlank(parentName); @@ -1971,10 +1971,8 @@ private CodegenDiscriminator createDiscriminator(String schemaName, Schema schem Map allDefinitions = ModelUtils.getSchemas(this.openAPI); allDefinitions.forEach((childName, child) -> { if (child instanceof ComposedSchema && ((ComposedSchema) child).getAllOf() != null) { - Set parentSchemas = ((ComposedSchema) child).getAllOf().stream() - .filter(s -> s.get$ref() != null) - .map(s -> ModelUtils.getSimpleRef(s.get$ref())) - .collect(Collectors.toSet()); + + final List parentSchemas = ModelUtils.getAllParentsName((ComposedSchema) child, allDefinitions, true); if (parentSchemas.contains(schemaName)) { discriminator.getMappedModels().add(new MappedModel(childName, toModelName(childName))); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java index 49cf187a13a6..4b95e1038d48 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java @@ -477,7 +477,7 @@ private static CodegenModel reconcileInlineEnums(CodegenModel codegenModel, Code // Because the child models extend the parents, the enums will be available via the parent. // Only bother with reconciliation if the parent model has enums. - if (!parentCodegenModel.hasEnums) { + if (parentCodegenModel == null || !parentCodegenModel.hasEnums) { return codegenModel; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java index 3efe1b9a6b0b..99232bc47bf8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java @@ -572,7 +572,7 @@ public CodegenModel fromModel(String name, Schema model) { } for (final CodegenProperty property : codegenModel.readWriteVars) { - if (property.defaultValue == null && property.baseName.equals(parentCodegenModel.discriminator.getPropertyName())) { + if (property.defaultValue == null && parentCodegenModel.discriminator != null && property.baseName.equals(parentCodegenModel.discriminator.getPropertyName())) { property.defaultValue = "\"" + name + "\""; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java index 34dd208b583f..20013cdf8ef5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java @@ -252,7 +252,7 @@ public CodegenModel fromModel(String name, Schema model) { } for (final CodegenProperty property : codegenModel.readWriteVars) { - if (property.defaultValue == null && property.baseName.equals(parentCodegenModel.discriminator.getPropertyName())) { + if (property.defaultValue == null && parentCodegenModel.discriminator != null && property.baseName.equals(parentCodegenModel.discriminator.getPropertyName())) { property.defaultValue = "\"" + name + "\""; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index 26b0b6539a9a..2ddb21ccb5b2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -923,7 +923,7 @@ public static String getParentName(ComposedSchema composedSchema, Map getAllParentsName(ComposedSchema composedSchema, Map allSchemas) { + public static List getAllParentsName(ComposedSchema composedSchema, Map allSchemas, boolean includeAncestors) { List interfaces = getInterfaces(composedSchema); List names = new ArrayList(); @@ -960,9 +960,12 @@ public static List getAllParentsName(ComposedSchema composedSchema, Map< if (s == null) { LOGGER.error("Failed to obtain schema from {}", parentName); names.add("UNKNOWN_PARENT_NAME"); - } else if (s.getDiscriminator() != null && StringUtils.isNotEmpty(s.getDiscriminator().getPropertyName())) { + } else if (hasOrInheritsDiscriminator(s, allSchemas)) { // discriminator.propertyName is used names.add(parentName); + if (includeAncestors && s instanceof ComposedSchema) { + names.addAll(getAllParentsName((ComposedSchema) s, allSchemas, true)); + } } else { LOGGER.debug("Not a parent since discriminator.propertyName is not set {}", s.get$ref()); // not a parent since discriminator.propertyName is not set @@ -976,6 +979,32 @@ public static List getAllParentsName(ComposedSchema composedSchema, Map< return names; } + private static boolean hasOrInheritsDiscriminator(Schema schema, Map allSchemas) { + if (schema.getDiscriminator() != null && StringUtils.isNotEmpty(schema.getDiscriminator().getPropertyName())) { + return true; + } + else if (StringUtils.isNotEmpty(schema.get$ref())) { + String parentName = getSimpleRef(schema.get$ref()); + Schema s = allSchemas.get(parentName); + if (s != null) { + return hasOrInheritsDiscriminator(s, allSchemas); + } + else { + LOGGER.error("Failed to obtain schema from {}", parentName); + } + } + else if (schema instanceof ComposedSchema) { + final ComposedSchema composed = (ComposedSchema) schema; + final List interfaces = getInterfaces(composed); + for (Schema i : interfaces) { + if (hasOrInheritsDiscriminator(i, allSchemas)) { + return true; + } + } + } + return false; + } + public static boolean isNullable(Schema schema) { if (schema == null) { return false; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index 4221086015c0..688f344f743e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -452,6 +452,7 @@ public void testDiscriminator() { test.setPropertyName("className"); test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Dog", "Dog")); test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Cat", "Cat")); + test.getMappedModels().add(new CodegenDiscriminator.MappedModel("BigCat", "BigCat")); Assert.assertEquals(discriminator, test); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJaxrsBaseTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJaxrsBaseTest.java index 0b782aa3c4eb..75434e4a7aff 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJaxrsBaseTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJaxrsBaseTest.java @@ -46,6 +46,7 @@ public void generateJsonAnnotationForPolymorphism() throws IOException { String jsonSubType = "@JsonSubTypes({\n" + " @JsonSubTypes.Type(value = Dog.class, name = \"Dog\"),\n" + " @JsonSubTypes.Type(value = Cat.class, name = \"Cat\"),\n" + + " @JsonSubTypes.Type(value = BigDog.class, name = \"BigDog\"),\n" + "})"; checkFileContains(generator, outputPath + "/src/gen/java/org/openapitools/model/Animal.java", jsonTypeInfo, jsonSubType); } diff --git a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index 73d734f75faa..02c9e70300b3 100644 --- a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1330,6 +1330,14 @@ definitions: properties: declawed: type: boolean + BigCat: + allOf: + - $ref: '#/definitions/Cat' + - type: object + properties: + kind: + type: string + enum: [lions, tigers, leopards, jaguars] Animal: type: object discriminator: className diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md index 46e3202f7158..eb8098a2e3b4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md @@ -145,6 +145,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) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/BigCat.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/BigCat.md new file mode 100644 index 000000000000..41c336e4ca9b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/BigCat.md @@ -0,0 +1,10 @@ +# 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) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/BigCatAllOf.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/BigCatAllOf.md new file mode 100644 index 000000000000..88a739b7e4ab --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/BigCatAllOf.md @@ -0,0 +1,9 @@ +# 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) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs new file mode 100644 index 000000000000..f1b24c7f8fe0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs @@ -0,0 +1,71 @@ +/* + * 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 Xunit; + +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 +{ + /// + /// Class for testing BigCatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BigCatAllOf + //private BigCatAllOf instance; + + public BigCatAllOfTests() + { + // TODO uncomment below to create an instance of BigCatAllOf + //instance = new BigCatAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BigCatAllOf + /// + [Fact] + public void BigCatAllOfInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" BigCatAllOf + //Assert.IsInstanceOfType (instance, "variable 'instance' is a BigCatAllOf"); + } + + + /// + /// Test the property 'Kind' + /// + [Fact] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatTests.cs new file mode 100644 index 000000000000..4bda812119c5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatTests.cs @@ -0,0 +1,71 @@ +/* + * 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 Xunit; + +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 +{ + /// + /// Class for testing BigCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BigCat + //private BigCat instance; + + public BigCatTests() + { + // TODO uncomment below to create an instance of BigCat + //instance = new BigCat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BigCat + /// + [Fact] + public void BigCatInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" BigCat + //Assert.IsInstanceOfType (instance, "variable 'instance' is a BigCat"); + } + + + /// + /// Test the property 'Kind' + /// + [Fact] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs index 8631afa2dba2..43b638c4a8d8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs @@ -34,8 +34,10 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(JsonSubtypes), "ClassName")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + [JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + [JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")] public partial class Animal : IEquatable, IValidatableObject { /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BigCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BigCat.cs new file mode 100644 index 000000000000..2fd960256c46 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BigCat.cs @@ -0,0 +1,158 @@ +/* + * 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; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCat + /// + [DataContract] + public partial class BigCat : Cat, IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BigCat() { } + /// + /// Initializes a new instance of the class. + /// + /// kind. + /// className (required). + /// color (default to "red"). + /// declawed. + public BigCat(KindEnum? kind = default(KindEnum?), string className = default(string), string color = "red", bool declawed = default(bool)) : base(declawed) + { + this.Kind = kind; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override 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 OpenAPIClientUtils.compareLogic.Compare(this, input as BigCat).AreEqual; + } + + /// + /// Returns true if BigCat instances are equal + /// + /// Instance of BigCat to be compared + /// Boolean + public bool Equals(BigCat input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + foreach(var x in BaseValidate(validationContext)) yield return x; + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BigCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BigCatAllOf.cs new file mode 100644 index 000000000000..5244a8f34882 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/BigCatAllOf.cs @@ -0,0 +1,148 @@ +/* + * 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; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCatAllOf + /// + [DataContract] + public partial class BigCatAllOf : IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public BigCatAllOf(KindEnum? kind = default(KindEnum?)) + { + this.Kind = kind; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// 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 OpenAPIClientUtils.compareLogic.Compare(this, input as BigCatAllOf).AreEqual; + } + + /// + /// Returns true if BigCatAllOf instances are equal + /// + /// Instance of BigCatAllOf to be compared + /// Boolean + public bool Equals(BigCatAllOf input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = hashCode * 59 + this.Kind.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-netcore/OpenAPIClientCore/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md index 78b126b56416..fd42741e8d4b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md @@ -157,6 +157,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) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/BigCat.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/BigCat.md new file mode 100644 index 000000000000..41c336e4ca9b --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/BigCat.md @@ -0,0 +1,10 @@ +# 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) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/BigCatAllOf.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/BigCatAllOf.md new file mode 100644 index 000000000000..88a739b7e4ab --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/BigCatAllOf.md @@ -0,0 +1,9 @@ +# 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) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs new file mode 100644 index 000000000000..f1b24c7f8fe0 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs @@ -0,0 +1,71 @@ +/* + * 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 Xunit; + +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 +{ + /// + /// Class for testing BigCatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatAllOfTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BigCatAllOf + //private BigCatAllOf instance; + + public BigCatAllOfTests() + { + // TODO uncomment below to create an instance of BigCatAllOf + //instance = new BigCatAllOf(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BigCatAllOf + /// + [Fact] + public void BigCatAllOfInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" BigCatAllOf + //Assert.IsInstanceOfType (instance, "variable 'instance' is a BigCatAllOf"); + } + + + /// + /// Test the property 'Kind' + /// + [Fact] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/BigCatTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/BigCatTests.cs new file mode 100644 index 000000000000..4bda812119c5 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/BigCatTests.cs @@ -0,0 +1,71 @@ +/* + * 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 Xunit; + +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 +{ + /// + /// Class for testing BigCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatTests : IDisposable + { + // TODO uncomment below to declare an instance variable for BigCat + //private BigCat instance; + + public BigCatTests() + { + // TODO uncomment below to create an instance of BigCat + //instance = new BigCat(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of BigCat + /// + [Fact] + public void BigCatInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" BigCat + //Assert.IsInstanceOfType (instance, "variable 'instance' is a BigCat"); + } + + + /// + /// Test the property 'Kind' + /// + [Fact] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs index 8631afa2dba2..43b638c4a8d8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs @@ -34,8 +34,10 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(JsonSubtypes), "ClassName")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + [JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + [JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")] public partial class Animal : IEquatable, IValidatableObject { /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BigCat.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BigCat.cs new file mode 100644 index 000000000000..2fd960256c46 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BigCat.cs @@ -0,0 +1,158 @@ +/* + * 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; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCat + /// + [DataContract] + public partial class BigCat : Cat, IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BigCat() { } + /// + /// Initializes a new instance of the class. + /// + /// kind. + /// className (required). + /// color (default to "red"). + /// declawed. + public BigCat(KindEnum? kind = default(KindEnum?), string className = default(string), string color = "red", bool declawed = default(bool)) : base(declawed) + { + this.Kind = kind; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override 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 OpenAPIClientUtils.compareLogic.Compare(this, input as BigCat).AreEqual; + } + + /// + /// Returns true if BigCat instances are equal + /// + /// Instance of BigCat to be compared + /// Boolean + public bool Equals(BigCat input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + foreach(var x in BaseValidate(validationContext)) yield return x; + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BigCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BigCatAllOf.cs new file mode 100644 index 000000000000..5244a8f34882 --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/BigCatAllOf.cs @@ -0,0 +1,148 @@ +/* + * 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; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCatAllOf + /// + [DataContract] + public partial class BigCatAllOf : IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public BigCatAllOf(KindEnum? kind = default(KindEnum?)) + { + this.Kind = kind; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// 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 OpenAPIClientUtils.compareLogic.Compare(this, input as BigCatAllOf).AreEqual; + } + + /// + /// Returns true if BigCatAllOf instances are equal + /// + /// Instance of BigCatAllOf to be compared + /// Boolean + public bool Equals(BigCatAllOf input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = hashCode * 59 + this.Kind.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/OpenAPIClient/README.md b/samples/client/petstore/csharp/OpenAPIClient/README.md index 7bd9201f88b7..5f55053b6f59 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient/README.md @@ -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) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/BigCat.md b/samples/client/petstore/csharp/OpenAPIClient/docs/BigCat.md new file mode 100644 index 000000000000..6247107ab35f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/BigCat.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/BigCatAllOf.md b/samples/client/petstore/csharp/OpenAPIClient/docs/BigCatAllOf.md new file mode 100644 index 000000000000..864c2298e03c --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/BigCatAllOf.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs new file mode 100644 index 000000000000..4cbdb4b8a5e5 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs @@ -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 +{ + /// + /// Class for testing BigCatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatAllOfTests + { + // TODO uncomment below to declare an instance variable for BigCatAllOf + //private BigCatAllOf instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of BigCatAllOf + //instance = new BigCatAllOf(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of BigCatAllOf + /// + [Test] + public void BigCatAllOfInstanceTest() + { + // TODO uncomment below to test "IsInstanceOf" BigCatAllOf + //Assert.IsInstanceOf(typeof(BigCatAllOf), instance); + } + + + /// + /// Test the property 'Kind' + /// + [Test] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatTests.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatTests.cs new file mode 100644 index 000000000000..1d78ea9f1e6d --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/BigCatTests.cs @@ -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 +{ + /// + /// Class for testing BigCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatTests + { + // TODO uncomment below to declare an instance variable for BigCat + //private BigCat instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of BigCat + //instance = new BigCat(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of BigCat + /// + [Test] + public void BigCatInstanceTest() + { + // TODO uncomment below to test "IsInstanceOf" BigCat + //Assert.IsInstanceOf(typeof(BigCat), instance); + } + + + /// + /// Test the property 'Kind' + /// + [Test] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs index d158ed573a6d..eb9b58f20753 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs @@ -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, IValidatableObject { /// diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/BigCat.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/BigCat.cs new file mode 100644 index 000000000000..ffdab926c34c --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/BigCat.cs @@ -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 +{ + /// + /// BigCat + /// + [DataContract] + public partial class BigCat : Cat, IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BigCat() { } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public BigCat(KindEnum? kind = default(KindEnum?), string className = default(string), string color = "red", bool declawed = default(bool)) : base(declawed) + { + this.Kind = kind; + } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override 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 BigCat); + } + + /// + /// Returns true if BigCat instances are equal + /// + /// Instance of BigCat to be compared + /// Boolean + 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)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + 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; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + foreach(var x in base.BaseValidate(validationContext)) yield return x; + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/BigCatAllOf.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/BigCatAllOf.cs new file mode 100644 index 000000000000..79871b557bab --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/BigCatAllOf.cs @@ -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 +{ + /// + /// BigCatAllOf + /// + [DataContract] + public partial class BigCatAllOf : IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public BigCatAllOf(KindEnum? kind = default(KindEnum?)) + { + this.Kind = kind; + } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// 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 BigCatAllOf); + } + + /// + /// Returns true if BigCatAllOf instances are equal + /// + /// Instance of BigCatAllOf to be compared + /// Boolean + public bool Equals(BigCatAllOf input) + { + if (input == null) + return false; + + return + ( + this.Kind == input.Kind || + (this.Kind != null && + this.Kind.Equals(input.Kind)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + 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; + } + } + + /// + /// 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/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs index 1c28fb2755f7..42674c5ffce8 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs @@ -122,6 +122,16 @@ public override int GetHashCode() /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach(var x in base.BaseValidate(validationContext)) yield return x; yield break; diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat.ex new file mode 100644 index 000000000000..46d755bde725 --- /dev/null +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat.ex @@ -0,0 +1,31 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenapiPetstore.Model.BigCat do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"className", + :"color", + :"declawed", + :"kind" + ] + + @type t :: %__MODULE__{ + :"className" => String.t, + :"color" => String.t | nil, + :"declawed" => boolean() | nil, + :"kind" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenapiPetstore.Model.BigCat do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat_all_of.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat_all_of.ex new file mode 100644 index 000000000000..739bdd5ee4dc --- /dev/null +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/big_cat_all_of.ex @@ -0,0 +1,25 @@ +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# https://openapi-generator.tech +# Do not edit the class manually. + +defmodule OpenapiPetstore.Model.BigCatAllOf do + @moduledoc """ + + """ + + @derive [Poison.Encoder] + defstruct [ + :"kind" + ] + + @type t :: %__MODULE__{ + :"kind" => String.t | nil + } +end + +defimpl Poison.Decoder, for: OpenapiPetstore.Model.BigCatAllOf do + def decode(value, _options) do + value + end +end + diff --git a/samples/client/petstore/go/go-petstore-withXml/README.md b/samples/client/petstore/go/go-petstore-withXml/README.md index 052b43c30a61..3ea727c1d17a 100644 --- a/samples/client/petstore/go/go-petstore-withXml/README.md +++ b/samples/client/petstore/go/go-petstore-withXml/README.md @@ -86,6 +86,8 @@ Class | Method | HTTP request | Description - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) + - [BigCat](docs/BigCat.md) + - [BigCatAllOf](docs/BigCatAllOf.md) - [Capitalization](docs/Capitalization.md) - [Cat](docs/Cat.md) - [CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml index 94c46a5bb5db..be5513053398 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml @@ -1422,6 +1422,10 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/BigCat_allOf' Animal: discriminator: propertyName: className @@ -2086,6 +2090,15 @@ components: properties: declawed: type: boolean + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/BigCat.md b/samples/client/petstore/go/go-petstore-withXml/docs/BigCat.md new file mode 100644 index 000000000000..a23cd724fb99 --- /dev/null +++ b/samples/client/petstore/go/go-petstore-withXml/docs/BigCat.md @@ -0,0 +1,14 @@ +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to red] +**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) + + diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/BigCatAllOf.md b/samples/client/petstore/go/go-petstore-withXml/docs/BigCatAllOf.md new file mode 100644 index 000000000000..03d37ee1031a --- /dev/null +++ b/samples/client/petstore/go/go-petstore-withXml/docs/BigCatAllOf.md @@ -0,0 +1,11 @@ +# 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) + + diff --git a/samples/client/petstore/go/go-petstore-withXml/model_big_cat.go b/samples/client/petstore/go/go-petstore-withXml/model_big_cat.go new file mode 100644 index 000000000000..a0a9c70fd860 --- /dev/null +++ b/samples/client/petstore/go/go-petstore-withXml/model_big_cat.go @@ -0,0 +1,18 @@ +/* + * 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: \" \\ + * + * API version: 1.0.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package petstore +// BigCat struct for BigCat +type BigCat struct { + ClassName string `json:"className" xml:"className"` + Color string `json:"color,omitempty" xml:"color"` + Declawed bool `json:"declawed,omitempty" xml:"declawed"` + Kind string `json:"kind,omitempty" xml:"kind"` +} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go b/samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go new file mode 100644 index 000000000000..49e5fa32504c --- /dev/null +++ b/samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go @@ -0,0 +1,15 @@ +/* + * 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: \" \\ + * + * API version: 1.0.0 + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package petstore +// BigCatAllOf struct for BigCatAllOf +type BigCatAllOf struct { + Kind string `json:"kind,omitempty" xml:"kind"` +} diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index 052b43c30a61..3ea727c1d17a 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -86,6 +86,8 @@ Class | Method | HTTP request | Description - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) + - [BigCat](docs/BigCat.md) + - [BigCatAllOf](docs/BigCatAllOf.md) - [Capitalization](docs/Capitalization.md) - [Cat](docs/Cat.md) - [CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/go/go-petstore/api/openapi.yaml b/samples/client/petstore/go/go-petstore/api/openapi.yaml index 94c46a5bb5db..be5513053398 100644 --- a/samples/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore/api/openapi.yaml @@ -1422,6 +1422,10 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/BigCat_allOf' Animal: discriminator: propertyName: className @@ -2086,6 +2090,15 @@ components: properties: declawed: type: boolean + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/go/go-petstore/docs/BigCat.md b/samples/client/petstore/go/go-petstore/docs/BigCat.md new file mode 100644 index 000000000000..a23cd724fb99 --- /dev/null +++ b/samples/client/petstore/go/go-petstore/docs/BigCat.md @@ -0,0 +1,14 @@ +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | **string** | | +**Color** | **string** | | [optional] [default to red] +**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) + + diff --git a/samples/client/petstore/go/go-petstore/docs/BigCatAllOf.md b/samples/client/petstore/go/go-petstore/docs/BigCatAllOf.md new file mode 100644 index 000000000000..03d37ee1031a --- /dev/null +++ b/samples/client/petstore/go/go-petstore/docs/BigCatAllOf.md @@ -0,0 +1,11 @@ +# 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) + + diff --git a/samples/client/petstore/go/go-petstore/model_big_cat.go b/samples/client/petstore/go/go-petstore/model_big_cat.go new file mode 100644 index 000000000000..70d790c65426 --- /dev/null +++ b/samples/client/petstore/go/go-petstore/model_big_cat.go @@ -0,0 +1,17 @@ +/* + * 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: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package petstore +// BigCat struct for BigCat +type BigCat struct { + ClassName string `json:"className"` + Color string `json:"color,omitempty"` + Declawed bool `json:"declawed,omitempty"` + Kind string `json:"kind,omitempty"` +} diff --git a/samples/client/petstore/go/go-petstore/model_big_cat_all_of.go b/samples/client/petstore/go/go-petstore/model_big_cat_all_of.go new file mode 100644 index 000000000000..93e796483ac8 --- /dev/null +++ b/samples/client/petstore/go/go-petstore/model_big_cat_all_of.go @@ -0,0 +1,14 @@ +/* + * 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: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package petstore +// BigCatAllOf struct for BigCatAllOf +type BigCatAllOf struct { + Kind string `json:"kind,omitempty"` +} diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs index 8bfb741aeb1a..1331ed4b237d 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs @@ -653,6 +653,75 @@ mkArrayTest = , arrayTestArrayArrayOfModel = Nothing } +-- ** BigCat +-- | BigCat +data BigCat = BigCat + { bigCatClassName :: !(Text) -- ^ /Required/ "className" + , bigCatColor :: !(Maybe Text) -- ^ "color" + , bigCatDeclawed :: !(Maybe Bool) -- ^ "declawed" + , bigCatKind :: !(Maybe E'Kind) -- ^ "kind" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON BigCat +instance A.FromJSON BigCat where + parseJSON = A.withObject "BigCat" $ \o -> + BigCat + <$> (o .: "className") + <*> (o .:? "color") + <*> (o .:? "declawed") + <*> (o .:? "kind") + +-- | ToJSON BigCat +instance A.ToJSON BigCat where + toJSON BigCat {..} = + _omitNulls + [ "className" .= bigCatClassName + , "color" .= bigCatColor + , "declawed" .= bigCatDeclawed + , "kind" .= bigCatKind + ] + + +-- | Construct a value of type 'BigCat' (by applying it's required fields, if any) +mkBigCat + :: Text -- ^ 'bigCatClassName' + -> BigCat +mkBigCat bigCatClassName = + BigCat + { bigCatClassName + , bigCatColor = Nothing + , bigCatDeclawed = Nothing + , bigCatKind = Nothing + } + +-- ** BigCatAllOf +-- | BigCatAllOf +data BigCatAllOf = BigCatAllOf + { bigCatAllOfKind :: !(Maybe E'Kind) -- ^ "kind" + } deriving (P.Show, P.Eq, P.Typeable) + +-- | FromJSON BigCatAllOf +instance A.FromJSON BigCatAllOf where + parseJSON = A.withObject "BigCatAllOf" $ \o -> + BigCatAllOf + <$> (o .:? "kind") + +-- | ToJSON BigCatAllOf +instance A.ToJSON BigCatAllOf where + toJSON BigCatAllOf {..} = + _omitNulls + [ "kind" .= bigCatAllOfKind + ] + + +-- | Construct a value of type 'BigCatAllOf' (by applying it's required fields, if any) +mkBigCatAllOf + :: BigCatAllOf +mkBigCatAllOf = + BigCatAllOf + { bigCatAllOfKind = Nothing + } + -- ** Capitalization -- | Capitalization data Capitalization = Capitalization @@ -2199,6 +2268,40 @@ toE'JustSymbol = \case s -> P.Left $ "toE'JustSymbol: enum parse failure: " P.++ P.show s +-- ** E'Kind + +-- | Enum of 'Text' +data E'Kind + = E'Kind'Lions -- ^ @"lions"@ + | E'Kind'Tigers -- ^ @"tigers"@ + | E'Kind'Leopards -- ^ @"leopards"@ + | E'Kind'Jaguars -- ^ @"jaguars"@ + deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) + +instance A.ToJSON E'Kind where toJSON = A.toJSON . fromE'Kind +instance A.FromJSON E'Kind where parseJSON o = P.either P.fail (pure . P.id) . toE'Kind =<< A.parseJSON o +instance WH.ToHttpApiData E'Kind where toQueryParam = WH.toQueryParam . fromE'Kind +instance WH.FromHttpApiData E'Kind where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Kind +instance MimeRender MimeMultipartFormData E'Kind where mimeRender _ = mimeRenderDefaultMultipartFormData + +-- | unwrap 'E'Kind' enum +fromE'Kind :: E'Kind -> Text +fromE'Kind = \case + E'Kind'Lions -> "lions" + E'Kind'Tigers -> "tigers" + E'Kind'Leopards -> "leopards" + E'Kind'Jaguars -> "jaguars" + +-- | parse 'E'Kind' enum +toE'Kind :: Text -> P.Either String E'Kind +toE'Kind = \case + "lions" -> P.Right E'Kind'Lions + "tigers" -> P.Right E'Kind'Tigers + "leopards" -> P.Right E'Kind'Leopards + "jaguars" -> P.Right E'Kind'Jaguars + s -> P.Left $ "toE'Kind: enum parse failure: " P.++ P.show s + + -- ** E'Status -- | Enum of 'Text' . diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs index 4926ee6c8302..32c3b2159809 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs @@ -228,6 +228,39 @@ arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> Ar +-- * BigCat + +-- | 'bigCatClassName' Lens +bigCatClassNameL :: Lens_' BigCat (Text) +bigCatClassNameL f BigCat{..} = (\bigCatClassName -> BigCat { bigCatClassName, ..} ) <$> f bigCatClassName +{-# INLINE bigCatClassNameL #-} + +-- | 'bigCatColor' Lens +bigCatColorL :: Lens_' BigCat (Maybe Text) +bigCatColorL f BigCat{..} = (\bigCatColor -> BigCat { bigCatColor, ..} ) <$> f bigCatColor +{-# INLINE bigCatColorL #-} + +-- | 'bigCatDeclawed' Lens +bigCatDeclawedL :: Lens_' BigCat (Maybe Bool) +bigCatDeclawedL f BigCat{..} = (\bigCatDeclawed -> BigCat { bigCatDeclawed, ..} ) <$> f bigCatDeclawed +{-# INLINE bigCatDeclawedL #-} + +-- | 'bigCatKind' Lens +bigCatKindL :: Lens_' BigCat (Maybe E'Kind) +bigCatKindL f BigCat{..} = (\bigCatKind -> BigCat { bigCatKind, ..} ) <$> f bigCatKind +{-# INLINE bigCatKindL #-} + + + +-- * BigCatAllOf + +-- | 'bigCatAllOfKind' Lens +bigCatAllOfKindL :: Lens_' BigCatAllOf (Maybe E'Kind) +bigCatAllOfKindL f BigCatAllOf{..} = (\bigCatAllOfKind -> BigCatAllOf { bigCatAllOfKind, ..} ) <$> f bigCatAllOfKind +{-# INLINE bigCatAllOfKindL #-} + + + -- * Capitalization -- | 'capitalizationSmallCamel' Lens diff --git a/samples/client/petstore/haskell-http-client/openapi.yaml b/samples/client/petstore/haskell-http-client/openapi.yaml index 94c46a5bb5db..be5513053398 100644 --- a/samples/client/petstore/haskell-http-client/openapi.yaml +++ b/samples/client/petstore/haskell-http-client/openapi.yaml @@ -1422,6 +1422,10 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/BigCat_allOf' Animal: discriminator: propertyName: className @@ -2086,6 +2090,15 @@ components: properties: declawed: type: boolean + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/haskell-http-client/tests/Instances.hs b/samples/client/petstore/haskell-http-client/tests/Instances.hs index 3b5bf7a9842c..bb674c55b3a4 100644 --- a/samples/client/petstore/haskell-http-client/tests/Instances.hs +++ b/samples/client/petstore/haskell-http-client/tests/Instances.hs @@ -223,6 +223,25 @@ genArrayTest n = <*> arbitraryReducedMaybe n -- arrayTestArrayArrayOfInteger :: Maybe [[Integer]] <*> arbitraryReducedMaybe n -- arrayTestArrayArrayOfModel :: Maybe [[ReadOnlyFirst]] +instance Arbitrary BigCat where + arbitrary = sized genBigCat + +genBigCat :: Int -> Gen BigCat +genBigCat n = + BigCat + <$> arbitrary -- bigCatClassName :: Text + <*> arbitraryReducedMaybe n -- bigCatColor :: Maybe Text + <*> arbitraryReducedMaybe n -- bigCatDeclawed :: Maybe Bool + <*> arbitraryReducedMaybe n -- bigCatKind :: Maybe E'Kind + +instance Arbitrary BigCatAllOf where + arbitrary = sized genBigCatAllOf + +genBigCatAllOf :: Int -> Gen BigCatAllOf +genBigCatAllOf n = + BigCatAllOf + <$> arbitraryReducedMaybe n -- bigCatAllOfKind :: Maybe E'Kind + instance Arbitrary Capitalization where arbitrary = sized genCapitalization @@ -598,6 +617,9 @@ instance Arbitrary E'Inner where instance Arbitrary E'JustSymbol where arbitrary = arbitraryBoundedEnum +instance Arbitrary E'Kind where + arbitrary = arbitraryBoundedEnum + instance Arbitrary E'Status where arbitrary = arbitraryBoundedEnum diff --git a/samples/client/petstore/haskell-http-client/tests/Test.hs b/samples/client/petstore/haskell-http-client/tests/Test.hs index 6db1f28e4d6d..bcb0761e838b 100644 --- a/samples/client/petstore/haskell-http-client/tests/Test.hs +++ b/samples/client/petstore/haskell-http-client/tests/Test.hs @@ -33,6 +33,8 @@ main = propMimeEq MimeJSON (Proxy :: Proxy ArrayOfArrayOfNumberOnly) propMimeEq MimeJSON (Proxy :: Proxy ArrayOfNumberOnly) propMimeEq MimeJSON (Proxy :: Proxy ArrayTest) + propMimeEq MimeJSON (Proxy :: Proxy BigCat) + propMimeEq MimeJSON (Proxy :: Proxy BigCatAllOf) propMimeEq MimeJSON (Proxy :: Proxy Capitalization) propMimeEq MimeJSON (Proxy :: Proxy Cat) propMimeEq MimeJSON (Proxy :: Proxy CatAllOf) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/feign10x/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/google-api-client/docs/BigCat.md b/samples/client/petstore/java/google-api-client/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/google-api-client/docs/BigCatAllOf.md b/samples/client/petstore/java/google-api-client/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/google-api-client/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey1/docs/BigCat.md b/samples/client/petstore/java/jersey1/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/jersey1/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey1/docs/BigCatAllOf.md b/samples/client/petstore/java/jersey1/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/jersey1/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey2-java6/docs/BigCat.md b/samples/client/petstore/java/jersey2-java6/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey2-java6/docs/BigCatAllOf.md b/samples/client/petstore/java/jersey2-java6/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java index cb94f281e853..741e51b2a6e9 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java @@ -36,6 +36,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..a3e0b8be2e1b --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/BigCat.java @@ -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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return ObjectUtils.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return ObjectUtils.hashCodeMulti(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..c3b5efaddd35 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,140 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return ObjectUtils.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return ObjectUtils.hashCodeMulti(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey2-java8/docs/BigCat.md b/samples/client/petstore/java/jersey2-java8/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey2-java8/docs/BigCatAllOf.md b/samples/client/petstore/java/jersey2-java8/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey2/docs/BigCat.md b/samples/client/petstore/java/jersey2/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey2/docs/BigCatAllOf.md b/samples/client/petstore/java/jersey2/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/native/docs/BigCat.md b/samples/client/petstore/java/native/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/native/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/native/docs/BigCatAllOf.md b/samples/client/petstore/java/native/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/native/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCat.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCatAllOf.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java index e23989865e01..3f214bf1fbf4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java @@ -58,6 +58,7 @@ public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class); classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class); + classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class); classByDiscriminatorValue.put("Animal".toUpperCase(Locale.ROOT), Animal.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..d3bc09ea37fd --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,182 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import android.os.Parcelable; +import android.os.Parcel; + +/** + * BigCat + */ + +public class BigCat extends Cat implements Parcelable { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + public BigCat() { + super(); + } + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public void writeToParcel(Parcel out, int flags) { + super.writeToParcel(out, flags); + out.writeValue(kind); + } + + BigCat(Parcel in) { + super(in); + kind = (KindEnum)in.readValue(null); + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + public BigCat createFromParcel(Parcel in) { + return new BigCat(in); + } + public BigCat[] newArray(int size) { + return new BigCat[size]; + } + }; +} + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..1cc92cea52c8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,175 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import android.os.Parcelable; +import android.os.Parcel; + +/** + * BigCatAllOf + */ + +public class BigCatAllOf implements Parcelable { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + public BigCatAllOf() { + } + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public void writeToParcel(Parcel out, int flags) { + out.writeValue(kind); + } + + BigCatAllOf(Parcel in) { + kind = (KindEnum)in.readValue(null); + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + public BigCatAllOf createFromParcel(Parcel in) { + return new BigCatAllOf(in); + } + public BigCatAllOf[] newArray(int size) { + return new BigCatAllOf[size]; + } + }; +} + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..f7f725106d12 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,51 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..0cb50249725b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,77 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/okhttp-gson/docs/BigCat.md b/samples/client/petstore/java/okhttp-gson/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/BigCatAllOf.md b/samples/client/petstore/java/okhttp-gson/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java index e23989865e01..3f214bf1fbf4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java @@ -58,6 +58,7 @@ public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class); classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class); + classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class); classByDiscriminatorValue.put("Animal".toUpperCase(Locale.ROOT), Animal.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..74b7ddc8135b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,154 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; + +/** + * BigCat + */ + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..cd2207704bd1 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * BigCatAllOf + */ + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..f7f725106d12 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,51 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..0cb50249725b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,77 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/rest-assured/docs/BigCat.md b/samples/client/petstore/java/rest-assured/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/rest-assured/docs/BigCatAllOf.md b/samples/client/petstore/java/rest-assured/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/rest-assured/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java index e23989865e01..3f214bf1fbf4 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java @@ -58,6 +58,7 @@ public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class); classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class); + classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class); classByDiscriminatorValue.put("Animal".toUpperCase(Locale.ROOT), Animal.class); return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "className")); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..74b7ddc8135b --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,154 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; + +/** + * BigCat + */ + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..cd2207704bd1 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * BigCatAllOf + */ + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..f7f725106d12 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,51 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..0cb50249725b --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,77 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/resteasy/docs/BigCat.md b/samples/client/petstore/java/resteasy/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/resteasy/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/resteasy/docs/BigCatAllOf.md b/samples/client/petstore/java/resteasy/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/resteasy/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/BigCat.md b/samples/client/petstore/java/resttemplate-withXml/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/BigCatAllOf.md b/samples/client/petstore/java/resttemplate-withXml/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java index 38646431b455..9b0fa3ff89d8 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java @@ -39,6 +39,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) @XmlRootElement(name = "Animal") diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..a578309d5b51 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,152 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +@XmlRootElement(name = "BigCat") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "BigCat") +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @XmlElement(name = "kind") + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "kind") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..65817c4f4c8d --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,148 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +@XmlRootElement(name = "BigCatAllOf") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "BigCatAllOf") +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @XmlElement(name = "kind") + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "kind") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/resttemplate/docs/BigCat.md b/samples/client/petstore/java/resttemplate/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/resttemplate/docs/BigCatAllOf.md b/samples/client/petstore/java/resttemplate/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..74b7ddc8135b --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,154 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; + +/** + * BigCat + */ + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..cd2207704bd1 --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * BigCatAllOf + */ + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..f7f725106d12 --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,51 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..0cb50249725b --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,77 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2-play24/docs/BigCat.md b/samples/client/petstore/java/retrofit2-play24/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/BigCatAllOf.md b/samples/client/petstore/java/retrofit2-play24/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java index fa37d5584483..6f607263996a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java @@ -39,6 +39,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..fa4339d591bc --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/BigCat.java @@ -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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..754e37125b36 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,143 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2-play25/docs/BigCat.md b/samples/client/petstore/java/retrofit2-play25/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/BigCatAllOf.md b/samples/client/petstore/java/retrofit2-play25/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java index fa37d5584483..6f607263996a 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java @@ -39,6 +39,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..fa4339d591bc --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/BigCat.java @@ -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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..754e37125b36 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,143 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2-play26/docs/BigCat.md b/samples/client/petstore/java/retrofit2-play26/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2-play26/docs/BigCatAllOf.md b/samples/client/petstore/java/retrofit2-play26/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java index fa37d5584483..6f607263996a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java @@ -39,6 +39,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..fa4339d591bc --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java @@ -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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..754e37125b36 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,143 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2/docs/BigCat.md b/samples/client/petstore/java/retrofit2/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2/docs/BigCatAllOf.md b/samples/client/petstore/java/retrofit2/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java index 607f7de40b21..f5933046f948 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java @@ -55,6 +55,7 @@ public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class); classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class); + classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class); classByDiscriminatorValue.put("Animal".toUpperCase(Locale.ROOT), Animal.class); return getClassByDiscriminator( classByDiscriminatorValue, diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..74b7ddc8135b --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,154 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; + +/** + * BigCat + */ + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..cd2207704bd1 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * BigCatAllOf + */ + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..f7f725106d12 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,51 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..0cb50249725b --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,77 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2rx/docs/BigCat.md b/samples/client/petstore/java/retrofit2rx/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/BigCatAllOf.md b/samples/client/petstore/java/retrofit2rx/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/JSON.java index 607f7de40b21..f5933046f948 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/JSON.java @@ -55,6 +55,7 @@ public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class); classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class); + classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class); classByDiscriminatorValue.put("Animal".toUpperCase(Locale.ROOT), Animal.class); return getClassByDiscriminator( classByDiscriminatorValue, diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..74b7ddc8135b --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,154 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; + +/** + * BigCat + */ + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..cd2207704bd1 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * BigCatAllOf + */ + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..f7f725106d12 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,51 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..0cb50249725b --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,77 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2rx2/docs/BigCat.md b/samples/client/petstore/java/retrofit2rx2/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/BigCatAllOf.md b/samples/client/petstore/java/retrofit2rx2/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java index 607f7de40b21..f5933046f948 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java @@ -55,6 +55,7 @@ public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class); classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class); + classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class); classByDiscriminatorValue.put("Animal".toUpperCase(Locale.ROOT), Animal.class); return getClassByDiscriminator( classByDiscriminatorValue, diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..74b7ddc8135b --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,154 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; + +/** + * BigCat + */ + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..cd2207704bd1 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * BigCatAllOf + */ + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..f7f725106d12 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,51 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..0cb50249725b --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,77 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/vertx/docs/BigCat.md b/samples/client/petstore/java/vertx/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/vertx/docs/BigCatAllOf.md b/samples/client/petstore/java/vertx/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/webclient/docs/BigCat.md b/samples/client/petstore/java/webclient/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/webclient/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/webclient/docs/BigCatAllOf.md b/samples/client/petstore/java/webclient/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/webclient/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java index ff1d1f941aeb..a17f713859c3 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java @@ -37,6 +37,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 000000000000..84b3f05703b2 --- /dev/null +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCat kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 000000000000..7ce0ddb21f5a --- /dev/null +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + + public BigCatAllOf kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..a9b13011f001 --- /dev/null +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..006c80707427 --- /dev/null +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/javascript-es6/README.md b/samples/client/petstore/javascript-es6/README.md index 711b08bb799e..09bc0b0ffe97 100644 --- a/samples/client/petstore/javascript-es6/README.md +++ b/samples/client/petstore/javascript-es6/README.md @@ -174,6 +174,8 @@ Class | Method | HTTP request | Description - [OpenApiPetstore.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [OpenApiPetstore.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [OpenApiPetstore.ArrayTest](docs/ArrayTest.md) + - [OpenApiPetstore.BigCat](docs/BigCat.md) + - [OpenApiPetstore.BigCatAllOf](docs/BigCatAllOf.md) - [OpenApiPetstore.Capitalization](docs/Capitalization.md) - [OpenApiPetstore.Cat](docs/Cat.md) - [OpenApiPetstore.CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/javascript-es6/docs/BigCat.md b/samples/client/petstore/javascript-es6/docs/BigCat.md new file mode 100644 index 000000000000..bbd79b2ba1bb --- /dev/null +++ b/samples/client/petstore/javascript-es6/docs/BigCat.md @@ -0,0 +1,24 @@ +# OpenApiPetstore.BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + + + +## Enum: KindEnum + + +* `lions` (value: `"lions"`) + +* `tigers` (value: `"tigers"`) + +* `leopards` (value: `"leopards"`) + +* `jaguars` (value: `"jaguars"`) + + + + diff --git a/samples/client/petstore/javascript-es6/docs/BigCatAllOf.md b/samples/client/petstore/javascript-es6/docs/BigCatAllOf.md new file mode 100644 index 000000000000..c5e83bfdaebb --- /dev/null +++ b/samples/client/petstore/javascript-es6/docs/BigCatAllOf.md @@ -0,0 +1,24 @@ +# OpenApiPetstore.BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + + + +## Enum: KindEnum + + +* `lions` (value: `"lions"`) + +* `tigers` (value: `"tigers"`) + +* `leopards` (value: `"leopards"`) + +* `jaguars` (value: `"jaguars"`) + + + + diff --git a/samples/client/petstore/javascript-es6/src/index.js b/samples/client/petstore/javascript-es6/src/index.js index 105b2767803f..e4dc27efbc35 100644 --- a/samples/client/petstore/javascript-es6/src/index.js +++ b/samples/client/petstore/javascript-es6/src/index.js @@ -26,6 +26,8 @@ import ApiResponse from './model/ApiResponse'; import ArrayOfArrayOfNumberOnly from './model/ArrayOfArrayOfNumberOnly'; import ArrayOfNumberOnly from './model/ArrayOfNumberOnly'; import ArrayTest from './model/ArrayTest'; +import BigCat from './model/BigCat'; +import BigCatAllOf from './model/BigCatAllOf'; import Capitalization from './model/Capitalization'; import Cat from './model/Cat'; import CatAllOf from './model/CatAllOf'; @@ -183,6 +185,18 @@ export { */ ArrayTest, + /** + * The BigCat model constructor. + * @property {module:model/BigCat} + */ + BigCat, + + /** + * The BigCatAllOf model constructor. + * @property {module:model/BigCatAllOf} + */ + BigCatAllOf, + /** * The Capitalization model constructor. * @property {module:model/Capitalization} diff --git a/samples/client/petstore/javascript-es6/src/model/BigCat.js b/samples/client/petstore/javascript-es6/src/model/BigCat.js new file mode 100644 index 000000000000..764e45d31dc9 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/model/BigCat.js @@ -0,0 +1,132 @@ +/** + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import BigCatAllOf from './BigCatAllOf'; +import Cat from './Cat'; + +/** + * The BigCat model module. + * @module model/BigCat + * @version 1.0.0 + */ +class BigCat { + /** + * Constructs a new BigCat. + * @alias module:model/BigCat + * @extends module:model/Cat + * @implements module:model/Cat + * @implements module:model/BigCatAllOf + * @param className {String} + */ + constructor(className) { + Cat.initialize(this, className);BigCatAllOf.initialize(this); + BigCat.initialize(this, className); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, className) { + } + + /** + * Constructs a BigCat from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BigCat} obj Optional instance to populate. + * @return {module:model/BigCat} The populated BigCat instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new BigCat(); + Cat.constructFromObject(data, obj); + Cat.constructFromObject(data, obj); + BigCatAllOf.constructFromObject(data, obj); + + if (data.hasOwnProperty('kind')) { + obj['kind'] = ApiClient.convertToType(data['kind'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {module:model/BigCat.KindEnum} kind + */ +BigCat.prototype['kind'] = undefined; + + +// Implement Cat interface: +/** + * @member {String} className + */ +Cat.prototype['className'] = undefined; +/** + * @member {String} color + * @default 'red' + */ +Cat.prototype['color'] = 'red'; +/** + * @member {Boolean} declawed + */ +Cat.prototype['declawed'] = undefined; +// Implement BigCatAllOf interface: +/** + * @member {module:model/BigCatAllOf.KindEnum} kind + */ +BigCatAllOf.prototype['kind'] = undefined; + + + +/** + * Allowed values for the kind property. + * @enum {String} + * @readonly + */ +BigCat['KindEnum'] = { + + /** + * value: "lions" + * @const + */ + "lions": "lions", + + /** + * value: "tigers" + * @const + */ + "tigers": "tigers", + + /** + * value: "leopards" + * @const + */ + "leopards": "leopards", + + /** + * value: "jaguars" + * @const + */ + "jaguars": "jaguars" +}; + + + +export default BigCat; + diff --git a/samples/client/petstore/javascript-es6/src/model/BigCatAllOf.js b/samples/client/petstore/javascript-es6/src/model/BigCatAllOf.js new file mode 100644 index 000000000000..1b79f1a2849f --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/model/BigCatAllOf.js @@ -0,0 +1,104 @@ +/** + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The BigCatAllOf model module. + * @module model/BigCatAllOf + * @version 1.0.0 + */ +class BigCatAllOf { + /** + * Constructs a new BigCatAllOf. + * @alias module:model/BigCatAllOf + */ + constructor() { + + BigCatAllOf.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a BigCatAllOf from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BigCatAllOf} obj Optional instance to populate. + * @return {module:model/BigCatAllOf} The populated BigCatAllOf instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new BigCatAllOf(); + + if (data.hasOwnProperty('kind')) { + obj['kind'] = ApiClient.convertToType(data['kind'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {module:model/BigCatAllOf.KindEnum} kind + */ +BigCatAllOf.prototype['kind'] = undefined; + + + + + +/** + * Allowed values for the kind property. + * @enum {String} + * @readonly + */ +BigCatAllOf['KindEnum'] = { + + /** + * value: "lions" + * @const + */ + "lions": "lions", + + /** + * value: "tigers" + * @const + */ + "tigers": "tigers", + + /** + * value: "leopards" + * @const + */ + "leopards": "leopards", + + /** + * value: "jaguars" + * @const + */ + "jaguars": "jaguars" +}; + + + +export default BigCatAllOf; + diff --git a/samples/client/petstore/javascript-es6/test/model/BigCat.spec.js b/samples/client/petstore/javascript-es6/test/model/BigCat.spec.js new file mode 100644 index 000000000000..c21833ff2293 --- /dev/null +++ b/samples/client/petstore/javascript-es6/test/model/BigCat.spec.js @@ -0,0 +1,65 @@ +/** + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.BigCat(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BigCat', function() { + it('should create an instance of BigCat', function() { + // uncomment below and update the code to test BigCat + //var instane = new OpenApiPetstore.BigCat(); + //expect(instance).to.be.a(OpenApiPetstore.BigCat); + }); + + it('should have the property kind (base name: "kind")', function() { + // uncomment below and update the code to test the property kind + //var instane = new OpenApiPetstore.BigCat(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/test/model/BigCatAllOf.spec.js b/samples/client/petstore/javascript-es6/test/model/BigCatAllOf.spec.js new file mode 100644 index 000000000000..c27440b42c34 --- /dev/null +++ b/samples/client/petstore/javascript-es6/test/model/BigCatAllOf.spec.js @@ -0,0 +1,65 @@ +/** + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.BigCatAllOf(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BigCatAllOf', function() { + it('should create an instance of BigCatAllOf', function() { + // uncomment below and update the code to test BigCatAllOf + //var instane = new OpenApiPetstore.BigCatAllOf(); + //expect(instance).to.be.a(OpenApiPetstore.BigCatAllOf); + }); + + it('should have the property kind (base name: "kind")', function() { + // uncomment below and update the code to test the property kind + //var instane = new OpenApiPetstore.BigCatAllOf(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-promise-es6/README.md b/samples/client/petstore/javascript-promise-es6/README.md index b325aae54043..ed1a7dcbddf9 100644 --- a/samples/client/petstore/javascript-promise-es6/README.md +++ b/samples/client/petstore/javascript-promise-es6/README.md @@ -172,6 +172,8 @@ Class | Method | HTTP request | Description - [OpenApiPetstore.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [OpenApiPetstore.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [OpenApiPetstore.ArrayTest](docs/ArrayTest.md) + - [OpenApiPetstore.BigCat](docs/BigCat.md) + - [OpenApiPetstore.BigCatAllOf](docs/BigCatAllOf.md) - [OpenApiPetstore.Capitalization](docs/Capitalization.md) - [OpenApiPetstore.Cat](docs/Cat.md) - [OpenApiPetstore.CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/javascript-promise-es6/docs/BigCat.md b/samples/client/petstore/javascript-promise-es6/docs/BigCat.md new file mode 100644 index 000000000000..bbd79b2ba1bb --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/docs/BigCat.md @@ -0,0 +1,24 @@ +# OpenApiPetstore.BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + + + +## Enum: KindEnum + + +* `lions` (value: `"lions"`) + +* `tigers` (value: `"tigers"`) + +* `leopards` (value: `"leopards"`) + +* `jaguars` (value: `"jaguars"`) + + + + diff --git a/samples/client/petstore/javascript-promise-es6/docs/BigCatAllOf.md b/samples/client/petstore/javascript-promise-es6/docs/BigCatAllOf.md new file mode 100644 index 000000000000..c5e83bfdaebb --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/docs/BigCatAllOf.md @@ -0,0 +1,24 @@ +# OpenApiPetstore.BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + + + +## Enum: KindEnum + + +* `lions` (value: `"lions"`) + +* `tigers` (value: `"tigers"`) + +* `leopards` (value: `"leopards"`) + +* `jaguars` (value: `"jaguars"`) + + + + diff --git a/samples/client/petstore/javascript-promise-es6/src/index.js b/samples/client/petstore/javascript-promise-es6/src/index.js index 105b2767803f..e4dc27efbc35 100644 --- a/samples/client/petstore/javascript-promise-es6/src/index.js +++ b/samples/client/petstore/javascript-promise-es6/src/index.js @@ -26,6 +26,8 @@ import ApiResponse from './model/ApiResponse'; import ArrayOfArrayOfNumberOnly from './model/ArrayOfArrayOfNumberOnly'; import ArrayOfNumberOnly from './model/ArrayOfNumberOnly'; import ArrayTest from './model/ArrayTest'; +import BigCat from './model/BigCat'; +import BigCatAllOf from './model/BigCatAllOf'; import Capitalization from './model/Capitalization'; import Cat from './model/Cat'; import CatAllOf from './model/CatAllOf'; @@ -183,6 +185,18 @@ export { */ ArrayTest, + /** + * The BigCat model constructor. + * @property {module:model/BigCat} + */ + BigCat, + + /** + * The BigCatAllOf model constructor. + * @property {module:model/BigCatAllOf} + */ + BigCatAllOf, + /** * The Capitalization model constructor. * @property {module:model/Capitalization} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/BigCat.js b/samples/client/petstore/javascript-promise-es6/src/model/BigCat.js new file mode 100644 index 000000000000..764e45d31dc9 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/src/model/BigCat.js @@ -0,0 +1,132 @@ +/** + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import BigCatAllOf from './BigCatAllOf'; +import Cat from './Cat'; + +/** + * The BigCat model module. + * @module model/BigCat + * @version 1.0.0 + */ +class BigCat { + /** + * Constructs a new BigCat. + * @alias module:model/BigCat + * @extends module:model/Cat + * @implements module:model/Cat + * @implements module:model/BigCatAllOf + * @param className {String} + */ + constructor(className) { + Cat.initialize(this, className);BigCatAllOf.initialize(this); + BigCat.initialize(this, className); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, className) { + } + + /** + * Constructs a BigCat from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BigCat} obj Optional instance to populate. + * @return {module:model/BigCat} The populated BigCat instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new BigCat(); + Cat.constructFromObject(data, obj); + Cat.constructFromObject(data, obj); + BigCatAllOf.constructFromObject(data, obj); + + if (data.hasOwnProperty('kind')) { + obj['kind'] = ApiClient.convertToType(data['kind'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {module:model/BigCat.KindEnum} kind + */ +BigCat.prototype['kind'] = undefined; + + +// Implement Cat interface: +/** + * @member {String} className + */ +Cat.prototype['className'] = undefined; +/** + * @member {String} color + * @default 'red' + */ +Cat.prototype['color'] = 'red'; +/** + * @member {Boolean} declawed + */ +Cat.prototype['declawed'] = undefined; +// Implement BigCatAllOf interface: +/** + * @member {module:model/BigCatAllOf.KindEnum} kind + */ +BigCatAllOf.prototype['kind'] = undefined; + + + +/** + * Allowed values for the kind property. + * @enum {String} + * @readonly + */ +BigCat['KindEnum'] = { + + /** + * value: "lions" + * @const + */ + "lions": "lions", + + /** + * value: "tigers" + * @const + */ + "tigers": "tigers", + + /** + * value: "leopards" + * @const + */ + "leopards": "leopards", + + /** + * value: "jaguars" + * @const + */ + "jaguars": "jaguars" +}; + + + +export default BigCat; + diff --git a/samples/client/petstore/javascript-promise-es6/src/model/BigCatAllOf.js b/samples/client/petstore/javascript-promise-es6/src/model/BigCatAllOf.js new file mode 100644 index 000000000000..1b79f1a2849f --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/src/model/BigCatAllOf.js @@ -0,0 +1,104 @@ +/** + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The BigCatAllOf model module. + * @module model/BigCatAllOf + * @version 1.0.0 + */ +class BigCatAllOf { + /** + * Constructs a new BigCatAllOf. + * @alias module:model/BigCatAllOf + */ + constructor() { + + BigCatAllOf.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a BigCatAllOf from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BigCatAllOf} obj Optional instance to populate. + * @return {module:model/BigCatAllOf} The populated BigCatAllOf instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new BigCatAllOf(); + + if (data.hasOwnProperty('kind')) { + obj['kind'] = ApiClient.convertToType(data['kind'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {module:model/BigCatAllOf.KindEnum} kind + */ +BigCatAllOf.prototype['kind'] = undefined; + + + + + +/** + * Allowed values for the kind property. + * @enum {String} + * @readonly + */ +BigCatAllOf['KindEnum'] = { + + /** + * value: "lions" + * @const + */ + "lions": "lions", + + /** + * value: "tigers" + * @const + */ + "tigers": "tigers", + + /** + * value: "leopards" + * @const + */ + "leopards": "leopards", + + /** + * value: "jaguars" + * @const + */ + "jaguars": "jaguars" +}; + + + +export default BigCatAllOf; + diff --git a/samples/client/petstore/javascript-promise-es6/test/model/BigCat.spec.js b/samples/client/petstore/javascript-promise-es6/test/model/BigCat.spec.js new file mode 100644 index 000000000000..c21833ff2293 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/test/model/BigCat.spec.js @@ -0,0 +1,65 @@ +/** + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.BigCat(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BigCat', function() { + it('should create an instance of BigCat', function() { + // uncomment below and update the code to test BigCat + //var instane = new OpenApiPetstore.BigCat(); + //expect(instance).to.be.a(OpenApiPetstore.BigCat); + }); + + it('should have the property kind (base name: "kind")', function() { + // uncomment below and update the code to test the property kind + //var instane = new OpenApiPetstore.BigCat(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-promise-es6/test/model/BigCatAllOf.spec.js b/samples/client/petstore/javascript-promise-es6/test/model/BigCatAllOf.spec.js new file mode 100644 index 000000000000..c27440b42c34 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/test/model/BigCatAllOf.spec.js @@ -0,0 +1,65 @@ +/** + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.BigCatAllOf(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BigCatAllOf', function() { + it('should create an instance of BigCatAllOf', function() { + // uncomment below and update the code to test BigCatAllOf + //var instane = new OpenApiPetstore.BigCatAllOf(); + //expect(instance).to.be.a(OpenApiPetstore.BigCatAllOf); + }); + + it('should have the property kind (base name: "kind")', function() { + // uncomment below and update the code to test the property kind + //var instane = new OpenApiPetstore.BigCatAllOf(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-promise/README.md b/samples/client/petstore/javascript-promise/README.md index 95124df42847..0f3fb9b8afc3 100644 --- a/samples/client/petstore/javascript-promise/README.md +++ b/samples/client/petstore/javascript-promise/README.md @@ -160,6 +160,8 @@ Class | Method | HTTP request | Description - [OpenApiPetstore.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [OpenApiPetstore.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [OpenApiPetstore.ArrayTest](docs/ArrayTest.md) + - [OpenApiPetstore.BigCat](docs/BigCat.md) + - [OpenApiPetstore.BigCatAllOf](docs/BigCatAllOf.md) - [OpenApiPetstore.Capitalization](docs/Capitalization.md) - [OpenApiPetstore.Cat](docs/Cat.md) - [OpenApiPetstore.CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/javascript-promise/docs/BigCat.md b/samples/client/petstore/javascript-promise/docs/BigCat.md new file mode 100644 index 000000000000..bbd79b2ba1bb --- /dev/null +++ b/samples/client/petstore/javascript-promise/docs/BigCat.md @@ -0,0 +1,24 @@ +# OpenApiPetstore.BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + + + +## Enum: KindEnum + + +* `lions` (value: `"lions"`) + +* `tigers` (value: `"tigers"`) + +* `leopards` (value: `"leopards"`) + +* `jaguars` (value: `"jaguars"`) + + + + diff --git a/samples/client/petstore/javascript-promise/docs/BigCatAllOf.md b/samples/client/petstore/javascript-promise/docs/BigCatAllOf.md new file mode 100644 index 000000000000..c5e83bfdaebb --- /dev/null +++ b/samples/client/petstore/javascript-promise/docs/BigCatAllOf.md @@ -0,0 +1,24 @@ +# OpenApiPetstore.BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + + + +## Enum: KindEnum + + +* `lions` (value: `"lions"`) + +* `tigers` (value: `"tigers"`) + +* `leopards` (value: `"leopards"`) + +* `jaguars` (value: `"jaguars"`) + + + + diff --git a/samples/client/petstore/javascript-promise/src/index.js b/samples/client/petstore/javascript-promise/src/index.js index 72b249026a9e..dd6cc5447f23 100644 --- a/samples/client/petstore/javascript-promise/src/index.js +++ b/samples/client/petstore/javascript-promise/src/index.js @@ -16,12 +16,12 @@ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/AdditionalPropertiesAnyType', 'model/AdditionalPropertiesArray', 'model/AdditionalPropertiesBoolean', 'model/AdditionalPropertiesClass', 'model/AdditionalPropertiesInteger', 'model/AdditionalPropertiesNumber', 'model/AdditionalPropertiesObject', 'model/AdditionalPropertiesString', 'model/Animal', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Cat', 'model/CatAllOf', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/DogAllOf', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/File', 'model/FileSchemaTestClass', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterComposite', 'model/OuterEnum', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/TypeHolderDefault', 'model/TypeHolderExample', 'model/User', 'model/XmlItem', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); + define(['ApiClient', 'model/AdditionalPropertiesAnyType', 'model/AdditionalPropertiesArray', 'model/AdditionalPropertiesBoolean', 'model/AdditionalPropertiesClass', 'model/AdditionalPropertiesInteger', 'model/AdditionalPropertiesNumber', 'model/AdditionalPropertiesObject', 'model/AdditionalPropertiesString', 'model/Animal', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/BigCat', 'model/BigCatAllOf', 'model/Capitalization', 'model/Cat', 'model/CatAllOf', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/DogAllOf', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/File', 'model/FileSchemaTestClass', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterComposite', 'model/OuterEnum', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/TypeHolderDefault', 'model/TypeHolderExample', 'model/User', 'model/XmlItem', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesAnyType'), require('./model/AdditionalPropertiesArray'), require('./model/AdditionalPropertiesBoolean'), require('./model/AdditionalPropertiesClass'), require('./model/AdditionalPropertiesInteger'), require('./model/AdditionalPropertiesNumber'), require('./model/AdditionalPropertiesObject'), require('./model/AdditionalPropertiesString'), require('./model/Animal'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Cat'), require('./model/CatAllOf'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/DogAllOf'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/File'), require('./model/FileSchemaTestClass'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/TypeHolderDefault'), require('./model/TypeHolderExample'), require('./model/User'), require('./model/XmlItem'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); + module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesAnyType'), require('./model/AdditionalPropertiesArray'), require('./model/AdditionalPropertiesBoolean'), require('./model/AdditionalPropertiesClass'), require('./model/AdditionalPropertiesInteger'), require('./model/AdditionalPropertiesNumber'), require('./model/AdditionalPropertiesObject'), require('./model/AdditionalPropertiesString'), require('./model/Animal'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/BigCat'), require('./model/BigCatAllOf'), require('./model/Capitalization'), require('./model/Cat'), require('./model/CatAllOf'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/DogAllOf'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/File'), require('./model/FileSchemaTestClass'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/TypeHolderDefault'), require('./model/TypeHolderExample'), require('./model/User'), require('./model/XmlItem'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); } -}(function(ApiClient, AdditionalPropertiesAnyType, AdditionalPropertiesArray, AdditionalPropertiesBoolean, AdditionalPropertiesClass, AdditionalPropertiesInteger, AdditionalPropertiesNumber, AdditionalPropertiesObject, AdditionalPropertiesString, Animal, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Cat, CatAllOf, Category, ClassModel, Client, Dog, DogAllOf, EnumArrays, EnumClass, EnumTest, File, FileSchemaTestClass, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterComposite, OuterEnum, Pet, ReadOnlyFirst, SpecialModelName, Tag, TypeHolderDefault, TypeHolderExample, User, XmlItem, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) { +}(function(ApiClient, AdditionalPropertiesAnyType, AdditionalPropertiesArray, AdditionalPropertiesBoolean, AdditionalPropertiesClass, AdditionalPropertiesInteger, AdditionalPropertiesNumber, AdditionalPropertiesObject, AdditionalPropertiesString, Animal, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, BigCat, BigCatAllOf, Capitalization, Cat, CatAllOf, Category, ClassModel, Client, Dog, DogAllOf, EnumArrays, EnumClass, EnumTest, File, FileSchemaTestClass, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterComposite, OuterEnum, Pet, ReadOnlyFirst, SpecialModelName, Tag, TypeHolderDefault, TypeHolderExample, User, XmlItem, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) { 'use strict'; /** @@ -126,6 +126,16 @@ * @property {module:model/ArrayTest} */ ArrayTest: ArrayTest, + /** + * The BigCat model constructor. + * @property {module:model/BigCat} + */ + BigCat: BigCat, + /** + * The BigCatAllOf model constructor. + * @property {module:model/BigCatAllOf} + */ + BigCatAllOf: BigCatAllOf, /** * The Capitalization model constructor. * @property {module:model/Capitalization} diff --git a/samples/client/petstore/javascript-promise/src/model/BigCat.js b/samples/client/petstore/javascript-promise/src/model/BigCat.js new file mode 100644 index 000000000000..e567df251ca3 --- /dev/null +++ b/samples/client/petstore/javascript-promise/src/model/BigCat.js @@ -0,0 +1,137 @@ +/** + * 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 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * + * OpenAPI Generator version: 4.2.2-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/BigCatAllOf', 'model/Cat'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./BigCatAllOf'), require('./Cat')); + } else { + // Browser globals (root is window) + if (!root.OpenApiPetstore) { + root.OpenApiPetstore = {}; + } + root.OpenApiPetstore.BigCat = factory(root.OpenApiPetstore.ApiClient, root.OpenApiPetstore.BigCatAllOf, root.OpenApiPetstore.Cat); + } +}(this, function(ApiClient, BigCatAllOf, Cat) { + 'use strict'; + + + + /** + * The BigCat model module. + * @module model/BigCat + * @version 1.0.0 + */ + + /** + * Constructs a new BigCat. + * @alias module:model/BigCat + * @class + * @extends module:model/Cat + * @implements module:model/Cat + * @implements module:model/BigCatAllOf + * @param className {String} + */ + var exports = function(className) { + var _this = this; + + Cat.call(_this, className); + }; + + /** + * Constructs a BigCat from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BigCat} obj Optional instance to populate. + * @return {module:model/BigCat} The populated BigCat instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + Cat.constructFromObject(data, obj); + if (data.hasOwnProperty('kind')) { + obj['kind'] = ApiClient.convertToType(data['kind'], 'String'); + } + } + return obj; + } + + exports.prototype = Object.create(Cat.prototype); + exports.prototype.constructor = exports; + + /** + * @member {module:model/BigCat.KindEnum} kind + */ + exports.prototype['kind'] = undefined; + + // Implement Cat interface: + /** + * @member {String} className + */ +exports.prototype['className'] = undefined; + + /** + * @member {String} color + * @default 'red' + */ +exports.prototype['color'] = 'red'; + + /** + * @member {Boolean} declawed + */ +exports.prototype['declawed'] = undefined; + + // Implement BigCatAllOf interface: + /** + * @member {module:model/BigCatAllOf.KindEnum} kind + */ +exports.prototype['kind'] = undefined; + + + /** + * Allowed values for the kind property. + * @enum {String} + * @readonly + */ + exports.KindEnum = { + /** + * value: "lions" + * @const + */ + "lions": "lions", + /** + * value: "tigers" + * @const + */ + "tigers": "tigers", + /** + * value: "leopards" + * @const + */ + "leopards": "leopards", + /** + * value: "jaguars" + * @const + */ + "jaguars": "jaguars" }; + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript-promise/src/model/BigCatAllOf.js b/samples/client/petstore/javascript-promise/src/model/BigCatAllOf.js new file mode 100644 index 000000000000..719ff31ec624 --- /dev/null +++ b/samples/client/petstore/javascript-promise/src/model/BigCatAllOf.js @@ -0,0 +1,105 @@ +/** + * 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 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * + * OpenAPI Generator version: 4.2.2-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.OpenApiPetstore) { + root.OpenApiPetstore = {}; + } + root.OpenApiPetstore.BigCatAllOf = factory(root.OpenApiPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + /** + * The BigCatAllOf model module. + * @module model/BigCatAllOf + * @version 1.0.0 + */ + + /** + * Constructs a new BigCatAllOf. + * @alias module:model/BigCatAllOf + * @class + */ + var exports = function() { + var _this = this; + + }; + + /** + * Constructs a BigCatAllOf from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BigCatAllOf} obj Optional instance to populate. + * @return {module:model/BigCatAllOf} The populated BigCatAllOf instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + if (data.hasOwnProperty('kind')) { + obj['kind'] = ApiClient.convertToType(data['kind'], 'String'); + } + } + return obj; + } + + /** + * @member {module:model/BigCatAllOf.KindEnum} kind + */ + exports.prototype['kind'] = undefined; + + + /** + * Allowed values for the kind property. + * @enum {String} + * @readonly + */ + exports.KindEnum = { + /** + * value: "lions" + * @const + */ + "lions": "lions", + /** + * value: "tigers" + * @const + */ + "tigers": "tigers", + /** + * value: "leopards" + * @const + */ + "leopards": "leopards", + /** + * value: "jaguars" + * @const + */ + "jaguars": "jaguars" }; + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript-promise/test/model/BigCat.spec.js b/samples/client/petstore/javascript-promise/test/model/BigCat.spec.js new file mode 100644 index 000000000000..2001b0a31fc1 --- /dev/null +++ b/samples/client/petstore/javascript-promise/test/model/BigCat.spec.js @@ -0,0 +1,67 @@ +/** + * 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 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * + * OpenAPI Generator version: 4.2.2-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.BigCat(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BigCat', function() { + it('should create an instance of BigCat', function() { + // uncomment below and update the code to test BigCat + //var instance = new OpenApiPetstore.BigCat(); + //expect(instance).to.be.a(OpenApiPetstore.BigCat); + }); + + it('should have the property kind (base name: "kind")', function() { + // uncomment below and update the code to test the property kind + //var instance = new OpenApiPetstore.BigCat(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-promise/test/model/BigCatAllOf.spec.js b/samples/client/petstore/javascript-promise/test/model/BigCatAllOf.spec.js new file mode 100644 index 000000000000..50d3277f5a6e --- /dev/null +++ b/samples/client/petstore/javascript-promise/test/model/BigCatAllOf.spec.js @@ -0,0 +1,67 @@ +/** + * 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 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * + * OpenAPI Generator version: 4.2.2-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.BigCatAllOf(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BigCatAllOf', function() { + it('should create an instance of BigCatAllOf', function() { + // uncomment below and update the code to test BigCatAllOf + //var instance = new OpenApiPetstore.BigCatAllOf(); + //expect(instance).to.be.a(OpenApiPetstore.BigCatAllOf); + }); + + it('should have the property kind (base name: "kind")', function() { + // uncomment below and update the code to test the property kind + //var instance = new OpenApiPetstore.BigCatAllOf(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript/README.md b/samples/client/petstore/javascript/README.md index c11860f76757..6b9b593afa04 100644 --- a/samples/client/petstore/javascript/README.md +++ b/samples/client/petstore/javascript/README.md @@ -163,6 +163,8 @@ Class | Method | HTTP request | Description - [OpenApiPetstore.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [OpenApiPetstore.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [OpenApiPetstore.ArrayTest](docs/ArrayTest.md) + - [OpenApiPetstore.BigCat](docs/BigCat.md) + - [OpenApiPetstore.BigCatAllOf](docs/BigCatAllOf.md) - [OpenApiPetstore.Capitalization](docs/Capitalization.md) - [OpenApiPetstore.Cat](docs/Cat.md) - [OpenApiPetstore.CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/javascript/docs/BigCat.md b/samples/client/petstore/javascript/docs/BigCat.md new file mode 100644 index 000000000000..bbd79b2ba1bb --- /dev/null +++ b/samples/client/petstore/javascript/docs/BigCat.md @@ -0,0 +1,24 @@ +# OpenApiPetstore.BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + + + +## Enum: KindEnum + + +* `lions` (value: `"lions"`) + +* `tigers` (value: `"tigers"`) + +* `leopards` (value: `"leopards"`) + +* `jaguars` (value: `"jaguars"`) + + + + diff --git a/samples/client/petstore/javascript/docs/BigCatAllOf.md b/samples/client/petstore/javascript/docs/BigCatAllOf.md new file mode 100644 index 000000000000..c5e83bfdaebb --- /dev/null +++ b/samples/client/petstore/javascript/docs/BigCatAllOf.md @@ -0,0 +1,24 @@ +# OpenApiPetstore.BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + + + +## Enum: KindEnum + + +* `lions` (value: `"lions"`) + +* `tigers` (value: `"tigers"`) + +* `leopards` (value: `"leopards"`) + +* `jaguars` (value: `"jaguars"`) + + + + diff --git a/samples/client/petstore/javascript/src/index.js b/samples/client/petstore/javascript/src/index.js index 72b249026a9e..dd6cc5447f23 100644 --- a/samples/client/petstore/javascript/src/index.js +++ b/samples/client/petstore/javascript/src/index.js @@ -16,12 +16,12 @@ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/AdditionalPropertiesAnyType', 'model/AdditionalPropertiesArray', 'model/AdditionalPropertiesBoolean', 'model/AdditionalPropertiesClass', 'model/AdditionalPropertiesInteger', 'model/AdditionalPropertiesNumber', 'model/AdditionalPropertiesObject', 'model/AdditionalPropertiesString', 'model/Animal', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Cat', 'model/CatAllOf', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/DogAllOf', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/File', 'model/FileSchemaTestClass', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterComposite', 'model/OuterEnum', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/TypeHolderDefault', 'model/TypeHolderExample', 'model/User', 'model/XmlItem', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); + define(['ApiClient', 'model/AdditionalPropertiesAnyType', 'model/AdditionalPropertiesArray', 'model/AdditionalPropertiesBoolean', 'model/AdditionalPropertiesClass', 'model/AdditionalPropertiesInteger', 'model/AdditionalPropertiesNumber', 'model/AdditionalPropertiesObject', 'model/AdditionalPropertiesString', 'model/Animal', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/BigCat', 'model/BigCatAllOf', 'model/Capitalization', 'model/Cat', 'model/CatAllOf', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/DogAllOf', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/File', 'model/FileSchemaTestClass', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterComposite', 'model/OuterEnum', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/TypeHolderDefault', 'model/TypeHolderExample', 'model/User', 'model/XmlItem', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesAnyType'), require('./model/AdditionalPropertiesArray'), require('./model/AdditionalPropertiesBoolean'), require('./model/AdditionalPropertiesClass'), require('./model/AdditionalPropertiesInteger'), require('./model/AdditionalPropertiesNumber'), require('./model/AdditionalPropertiesObject'), require('./model/AdditionalPropertiesString'), require('./model/Animal'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Cat'), require('./model/CatAllOf'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/DogAllOf'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/File'), require('./model/FileSchemaTestClass'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/TypeHolderDefault'), require('./model/TypeHolderExample'), require('./model/User'), require('./model/XmlItem'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); + module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesAnyType'), require('./model/AdditionalPropertiesArray'), require('./model/AdditionalPropertiesBoolean'), require('./model/AdditionalPropertiesClass'), require('./model/AdditionalPropertiesInteger'), require('./model/AdditionalPropertiesNumber'), require('./model/AdditionalPropertiesObject'), require('./model/AdditionalPropertiesString'), require('./model/Animal'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/BigCat'), require('./model/BigCatAllOf'), require('./model/Capitalization'), require('./model/Cat'), require('./model/CatAllOf'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/DogAllOf'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/File'), require('./model/FileSchemaTestClass'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/TypeHolderDefault'), require('./model/TypeHolderExample'), require('./model/User'), require('./model/XmlItem'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); } -}(function(ApiClient, AdditionalPropertiesAnyType, AdditionalPropertiesArray, AdditionalPropertiesBoolean, AdditionalPropertiesClass, AdditionalPropertiesInteger, AdditionalPropertiesNumber, AdditionalPropertiesObject, AdditionalPropertiesString, Animal, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Cat, CatAllOf, Category, ClassModel, Client, Dog, DogAllOf, EnumArrays, EnumClass, EnumTest, File, FileSchemaTestClass, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterComposite, OuterEnum, Pet, ReadOnlyFirst, SpecialModelName, Tag, TypeHolderDefault, TypeHolderExample, User, XmlItem, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) { +}(function(ApiClient, AdditionalPropertiesAnyType, AdditionalPropertiesArray, AdditionalPropertiesBoolean, AdditionalPropertiesClass, AdditionalPropertiesInteger, AdditionalPropertiesNumber, AdditionalPropertiesObject, AdditionalPropertiesString, Animal, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, BigCat, BigCatAllOf, Capitalization, Cat, CatAllOf, Category, ClassModel, Client, Dog, DogAllOf, EnumArrays, EnumClass, EnumTest, File, FileSchemaTestClass, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterComposite, OuterEnum, Pet, ReadOnlyFirst, SpecialModelName, Tag, TypeHolderDefault, TypeHolderExample, User, XmlItem, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) { 'use strict'; /** @@ -126,6 +126,16 @@ * @property {module:model/ArrayTest} */ ArrayTest: ArrayTest, + /** + * The BigCat model constructor. + * @property {module:model/BigCat} + */ + BigCat: BigCat, + /** + * The BigCatAllOf model constructor. + * @property {module:model/BigCatAllOf} + */ + BigCatAllOf: BigCatAllOf, /** * The Capitalization model constructor. * @property {module:model/Capitalization} diff --git a/samples/client/petstore/javascript/src/model/BigCat.js b/samples/client/petstore/javascript/src/model/BigCat.js new file mode 100644 index 000000000000..e567df251ca3 --- /dev/null +++ b/samples/client/petstore/javascript/src/model/BigCat.js @@ -0,0 +1,137 @@ +/** + * 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 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * + * OpenAPI Generator version: 4.2.2-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/BigCatAllOf', 'model/Cat'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./BigCatAllOf'), require('./Cat')); + } else { + // Browser globals (root is window) + if (!root.OpenApiPetstore) { + root.OpenApiPetstore = {}; + } + root.OpenApiPetstore.BigCat = factory(root.OpenApiPetstore.ApiClient, root.OpenApiPetstore.BigCatAllOf, root.OpenApiPetstore.Cat); + } +}(this, function(ApiClient, BigCatAllOf, Cat) { + 'use strict'; + + + + /** + * The BigCat model module. + * @module model/BigCat + * @version 1.0.0 + */ + + /** + * Constructs a new BigCat. + * @alias module:model/BigCat + * @class + * @extends module:model/Cat + * @implements module:model/Cat + * @implements module:model/BigCatAllOf + * @param className {String} + */ + var exports = function(className) { + var _this = this; + + Cat.call(_this, className); + }; + + /** + * Constructs a BigCat from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BigCat} obj Optional instance to populate. + * @return {module:model/BigCat} The populated BigCat instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + Cat.constructFromObject(data, obj); + if (data.hasOwnProperty('kind')) { + obj['kind'] = ApiClient.convertToType(data['kind'], 'String'); + } + } + return obj; + } + + exports.prototype = Object.create(Cat.prototype); + exports.prototype.constructor = exports; + + /** + * @member {module:model/BigCat.KindEnum} kind + */ + exports.prototype['kind'] = undefined; + + // Implement Cat interface: + /** + * @member {String} className + */ +exports.prototype['className'] = undefined; + + /** + * @member {String} color + * @default 'red' + */ +exports.prototype['color'] = 'red'; + + /** + * @member {Boolean} declawed + */ +exports.prototype['declawed'] = undefined; + + // Implement BigCatAllOf interface: + /** + * @member {module:model/BigCatAllOf.KindEnum} kind + */ +exports.prototype['kind'] = undefined; + + + /** + * Allowed values for the kind property. + * @enum {String} + * @readonly + */ + exports.KindEnum = { + /** + * value: "lions" + * @const + */ + "lions": "lions", + /** + * value: "tigers" + * @const + */ + "tigers": "tigers", + /** + * value: "leopards" + * @const + */ + "leopards": "leopards", + /** + * value: "jaguars" + * @const + */ + "jaguars": "jaguars" }; + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript/src/model/BigCatAllOf.js b/samples/client/petstore/javascript/src/model/BigCatAllOf.js new file mode 100644 index 000000000000..719ff31ec624 --- /dev/null +++ b/samples/client/petstore/javascript/src/model/BigCatAllOf.js @@ -0,0 +1,105 @@ +/** + * 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 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * + * OpenAPI Generator version: 4.2.2-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.OpenApiPetstore) { + root.OpenApiPetstore = {}; + } + root.OpenApiPetstore.BigCatAllOf = factory(root.OpenApiPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + /** + * The BigCatAllOf model module. + * @module model/BigCatAllOf + * @version 1.0.0 + */ + + /** + * Constructs a new BigCatAllOf. + * @alias module:model/BigCatAllOf + * @class + */ + var exports = function() { + var _this = this; + + }; + + /** + * Constructs a BigCatAllOf from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BigCatAllOf} obj Optional instance to populate. + * @return {module:model/BigCatAllOf} The populated BigCatAllOf instance. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + if (data.hasOwnProperty('kind')) { + obj['kind'] = ApiClient.convertToType(data['kind'], 'String'); + } + } + return obj; + } + + /** + * @member {module:model/BigCatAllOf.KindEnum} kind + */ + exports.prototype['kind'] = undefined; + + + /** + * Allowed values for the kind property. + * @enum {String} + * @readonly + */ + exports.KindEnum = { + /** + * value: "lions" + * @const + */ + "lions": "lions", + /** + * value: "tigers" + * @const + */ + "tigers": "tigers", + /** + * value: "leopards" + * @const + */ + "leopards": "leopards", + /** + * value: "jaguars" + * @const + */ + "jaguars": "jaguars" }; + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript/test/model/BigCat.spec.js b/samples/client/petstore/javascript/test/model/BigCat.spec.js new file mode 100644 index 000000000000..2001b0a31fc1 --- /dev/null +++ b/samples/client/petstore/javascript/test/model/BigCat.spec.js @@ -0,0 +1,67 @@ +/** + * 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 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * + * OpenAPI Generator version: 4.2.2-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.BigCat(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BigCat', function() { + it('should create an instance of BigCat', function() { + // uncomment below and update the code to test BigCat + //var instance = new OpenApiPetstore.BigCat(); + //expect(instance).to.be.a(OpenApiPetstore.BigCat); + }); + + it('should have the property kind (base name: "kind")', function() { + // uncomment below and update the code to test the property kind + //var instance = new OpenApiPetstore.BigCat(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript/test/model/BigCatAllOf.spec.js b/samples/client/petstore/javascript/test/model/BigCatAllOf.spec.js new file mode 100644 index 000000000000..50d3277f5a6e --- /dev/null +++ b/samples/client/petstore/javascript/test/model/BigCatAllOf.spec.js @@ -0,0 +1,67 @@ +/** + * 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 + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * + * OpenAPI Generator version: 4.2.2-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.BigCatAllOf(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BigCatAllOf', function() { + it('should create an instance of BigCatAllOf', function() { + // uncomment below and update the code to test BigCatAllOf + //var instance = new OpenApiPetstore.BigCatAllOf(); + //expect(instance).to.be.a(OpenApiPetstore.BigCatAllOf); + }); + + it('should have the property kind (base name: "kind")', function() { + // uncomment below and update the code to test the property kind + //var instance = new OpenApiPetstore.BigCatAllOf(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 6f5090566a95..c3c9c8ab6831 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -245,6 +245,8 @@ use WWW::OpenAPIClient::Object::ApiResponse; use WWW::OpenAPIClient::Object::ArrayOfArrayOfNumberOnly; use WWW::OpenAPIClient::Object::ArrayOfNumberOnly; use WWW::OpenAPIClient::Object::ArrayTest; +use WWW::OpenAPIClient::Object::BigCat; +use WWW::OpenAPIClient::Object::BigCatAllOf; use WWW::OpenAPIClient::Object::Capitalization; use WWW::OpenAPIClient::Object::Cat; use WWW::OpenAPIClient::Object::CatAllOf; @@ -310,6 +312,8 @@ use WWW::OpenAPIClient::Object::ApiResponse; use WWW::OpenAPIClient::Object::ArrayOfArrayOfNumberOnly; use WWW::OpenAPIClient::Object::ArrayOfNumberOnly; use WWW::OpenAPIClient::Object::ArrayTest; +use WWW::OpenAPIClient::Object::BigCat; +use WWW::OpenAPIClient::Object::BigCatAllOf; use WWW::OpenAPIClient::Object::Capitalization; use WWW::OpenAPIClient::Object::Cat; use WWW::OpenAPIClient::Object::CatAllOf; @@ -422,6 +426,8 @@ Class | Method | HTTP request | Description - [WWW::OpenAPIClient::Object::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [WWW::OpenAPIClient::Object::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [WWW::OpenAPIClient::Object::ArrayTest](docs/ArrayTest.md) + - [WWW::OpenAPIClient::Object::BigCat](docs/BigCat.md) + - [WWW::OpenAPIClient::Object::BigCatAllOf](docs/BigCatAllOf.md) - [WWW::OpenAPIClient::Object::Capitalization](docs/Capitalization.md) - [WWW::OpenAPIClient::Object::Cat](docs/Cat.md) - [WWW::OpenAPIClient::Object::CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/perl/docs/BigCat.md b/samples/client/petstore/perl/docs/BigCat.md new file mode 100644 index 000000000000..131eb61c20b1 --- /dev/null +++ b/samples/client/petstore/perl/docs/BigCat.md @@ -0,0 +1,15 @@ +# WWW::OpenAPIClient::Object::BigCat + +## Load the model package +```perl +use WWW::OpenAPIClient::Object::BigCat; +``` + +## 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) + + diff --git a/samples/client/petstore/perl/docs/BigCatAllOf.md b/samples/client/petstore/perl/docs/BigCatAllOf.md new file mode 100644 index 000000000000..d6561af78683 --- /dev/null +++ b/samples/client/petstore/perl/docs/BigCatAllOf.md @@ -0,0 +1,15 @@ +# WWW::OpenAPIClient::Object::BigCatAllOf + +## Load the model package +```perl +use WWW::OpenAPIClient::Object::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) + + diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/BigCat.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/BigCat.pm new file mode 100644 index 000000000000..f1cebb8ec7b2 --- /dev/null +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/BigCat.pm @@ -0,0 +1,198 @@ +=begin comment + +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://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# Do not edit the class manually. +# Ref: https://openapi-generator.tech +# +package WWW::OpenAPIClient::Object::BigCat; + +require 5.6.0; +use strict; +use warnings; +use utf8; +use JSON qw(decode_json); +use Data::Dumper; +use Module::Runtime qw(use_module); +use Log::Any qw($log); +use Date::Parse; +use DateTime; + +use WWW::OpenAPIClient::Object::BigCatAllOf; +use WWW::OpenAPIClient::Object::Cat; + +use base ("Class::Accessor", "Class::Data::Inheritable", "WWW::OpenAPIClient::Object::Cat"); + +# +# +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. +# REF: https://openapi-generator.tech +# + +=begin comment + +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://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# Do not edit the class manually. +# Ref: https://openapi-generator.tech +# +__PACKAGE__->mk_classdata('attribute_map' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); +__PACKAGE__->mk_classdata('method_documentation' => {}); +__PACKAGE__->mk_classdata('class_documentation' => {}); + +# new plain object +sub new { + my ($class, %args) = @_; + + my $self = bless {}, $class; + + $self->init(%args); + + return $self; +} + +# initialize the object +sub init +{ + my ($self, %args) = @_; + + foreach my $attribute (keys %{$self->attribute_map}) { + my $args_key = $self->attribute_map->{$attribute}; + $self->$attribute( $args{ $args_key } ); + } + + # initialize parent object Cat + $self->WWW::OpenAPIClient::Object::Cat::init(%args); +} + +# return perl hash +sub to_hash { + my $self = shift; + my $_hash = decode_json(JSON->new->convert_blessed->encode($self)); + + # call Cat to_hash and then combine hash + $_hash = { %$_hash, %$self->WWW::OpenAPIClient::Object::Cat::to_hash }; + + return $_hash; +} + +# used by JSON for serialization +sub TO_JSON { + my $self = shift; + my $_data = {}; + foreach my $_key (keys %{$self->attribute_map}) { + if (defined $self->{$_key}) { + $_data->{$self->attribute_map->{$_key}} = $self->{$_key}; + } + } + + # combine parent (Cat) TO_JSON + $_data = { %$_data, %$self->WWW::OpenAPIClient::Object::Cat::TO_JSON }; + + return $_data; +} + +# from Perl hashref +sub from_hash { + my ($self, $hash) = @_; + + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { + my $_json_attribute = $self->attribute_map->{$_key}; + if ($_type =~ /^array\[(.+)\]$/i) { # array + my $_subclass = $1; + my @_array = (); + foreach my $_element (@{$hash->{$_json_attribute}}) { + push @_array, $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \@_array; + } elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash + my $_subclass = $1; + my %_hash = (); + while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) { + $_hash{$_key} = $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \%_hash; + } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime + $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); + } else { + $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); + } + } + + # call parent (Cat) from_hash + $self->WWW::OpenAPIClient::Object::Cat::from_hash($hash); + + return $self; +} + +# deserialize non-array data +sub _deserialize { + my ($self, $type, $data) = @_; + $log->debugf("deserializing %s with %s",Dumper($data), $type); + + if ($type eq 'DateTime') { + return DateTime->from_epoch(epoch => str2time($data)); + } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) { + return $data; + } else { # hash(model) + my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()"; + return $_instance->from_hash($data); + } +} + + + +__PACKAGE__->class_documentation({description => '', + class => 'BigCat', + required => [], # TODO +} ); + +__PACKAGE__->method_documentation({ + 'kind' => { + datatype => 'string', + base_name => 'kind', + description => '', + format => '', + read_only => '', + }, +}); + +__PACKAGE__->openapi_types( { + 'kind' => 'string' +} ); + +__PACKAGE__->attribute_map( { + 'kind' => 'kind' +} ); + +__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); + + +1; diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/BigCatAllOf.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/BigCatAllOf.pm new file mode 100644 index 000000000000..8a36a3e02f6c --- /dev/null +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/BigCatAllOf.pm @@ -0,0 +1,184 @@ +=begin comment + +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://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# Do not edit the class manually. +# Ref: https://openapi-generator.tech +# +package WWW::OpenAPIClient::Object::BigCatAllOf; + +require 5.6.0; +use strict; +use warnings; +use utf8; +use JSON qw(decode_json); +use Data::Dumper; +use Module::Runtime qw(use_module); +use Log::Any qw($log); +use Date::Parse; +use DateTime; + + +use base ("Class::Accessor", "Class::Data::Inheritable"); + +# +# +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. +# REF: https://openapi-generator.tech +# + +=begin comment + +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://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +# Do not edit the class manually. +# Ref: https://openapi-generator.tech +# +__PACKAGE__->mk_classdata('attribute_map' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); +__PACKAGE__->mk_classdata('method_documentation' => {}); +__PACKAGE__->mk_classdata('class_documentation' => {}); + +# new plain object +sub new { + my ($class, %args) = @_; + + my $self = bless {}, $class; + + $self->init(%args); + + return $self; +} + +# initialize the object +sub init +{ + my ($self, %args) = @_; + + foreach my $attribute (keys %{$self->attribute_map}) { + my $args_key = $self->attribute_map->{$attribute}; + $self->$attribute( $args{ $args_key } ); + } +} + +# return perl hash +sub to_hash { + my $self = shift; + my $_hash = decode_json(JSON->new->convert_blessed->encode($self)); + + return $_hash; +} + +# used by JSON for serialization +sub TO_JSON { + my $self = shift; + my $_data = {}; + foreach my $_key (keys %{$self->attribute_map}) { + if (defined $self->{$_key}) { + $_data->{$self->attribute_map->{$_key}} = $self->{$_key}; + } + } + + return $_data; +} + +# from Perl hashref +sub from_hash { + my ($self, $hash) = @_; + + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { + my $_json_attribute = $self->attribute_map->{$_key}; + if ($_type =~ /^array\[(.+)\]$/i) { # array + my $_subclass = $1; + my @_array = (); + foreach my $_element (@{$hash->{$_json_attribute}}) { + push @_array, $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \@_array; + } elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash + my $_subclass = $1; + my %_hash = (); + while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) { + $_hash{$_key} = $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \%_hash; + } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime + $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); + } else { + $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); + } + } + + return $self; +} + +# deserialize non-array data +sub _deserialize { + my ($self, $type, $data) = @_; + $log->debugf("deserializing %s with %s",Dumper($data), $type); + + if ($type eq 'DateTime') { + return DateTime->from_epoch(epoch => str2time($data)); + } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) { + return $data; + } else { # hash(model) + my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()"; + return $_instance->from_hash($data); + } +} + + + +__PACKAGE__->class_documentation({description => '', + class => 'BigCatAllOf', + required => [], # TODO +} ); + +__PACKAGE__->method_documentation({ + 'kind' => { + datatype => 'string', + base_name => 'kind', + description => '', + format => '', + read_only => '', + }, +}); + +__PACKAGE__->openapi_types( { + 'kind' => 'string' +} ); + +__PACKAGE__->attribute_map( { + 'kind' => 'kind' +} ); + +__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); + + +1; diff --git a/samples/client/petstore/perl/t/BigCatAllOfTest.t b/samples/client/petstore/perl/t/BigCatAllOfTest.t new file mode 100644 index 000000000000..5708cbf33460 --- /dev/null +++ b/samples/client/petstore/perl/t/BigCatAllOfTest.t @@ -0,0 +1,33 @@ +=begin comment + +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://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the OpenAPI Generator +# Please update the test cases below to test the model. +# Ref: https://openapi-generator.tech +# +use Test::More tests => 2; +use Test::Exception; + +use lib 'lib'; +use strict; +use warnings; + + +use_ok('WWW::OpenAPIClient::Object::BigCatAllOf'); + +my $instance = WWW::OpenAPIClient::Object::BigCatAllOf->new(); + +isa_ok($instance, 'WWW::OpenAPIClient::Object::BigCatAllOf'); + diff --git a/samples/client/petstore/perl/t/BigCatTest.t b/samples/client/petstore/perl/t/BigCatTest.t new file mode 100644 index 000000000000..b1d4d7966bf3 --- /dev/null +++ b/samples/client/petstore/perl/t/BigCatTest.t @@ -0,0 +1,33 @@ +=begin comment + +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://openapi-generator.tech + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the OpenAPI Generator +# Please update the test cases below to test the model. +# Ref: https://openapi-generator.tech +# +use Test::More tests => 2; +use Test::Exception; + +use lib 'lib'; +use strict; +use warnings; + + +use_ok('WWW::OpenAPIClient::Object::BigCat'); + +my $instance = WWW::OpenAPIClient::Object::BigCat->new(); + +isa_ok($instance, 'WWW::OpenAPIClient::Object::BigCat'); + diff --git a/samples/client/petstore/php/OpenAPIClient-php/README.md b/samples/client/petstore/php/OpenAPIClient-php/README.md index f84c670fa306..87ba21d247f5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php/OpenAPIClient-php/README.md @@ -137,6 +137,8 @@ Class | Method | HTTP request | Description - [ArrayOfArrayOfNumberOnly](docs/Model/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/Model/ArrayOfNumberOnly.md) - [ArrayTest](docs/Model/ArrayTest.md) + - [BigCat](docs/Model/BigCat.md) + - [BigCatAllOf](docs/Model/BigCatAllOf.md) - [Capitalization](docs/Model/Capitalization.md) - [Cat](docs/Model/Cat.md) - [CatAllOf](docs/Model/CatAllOf.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/BigCat.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/BigCat.md new file mode 100644 index 000000000000..8aa1c543ea38 --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/BigCat.md @@ -0,0 +1,11 @@ +# # BigCat + +## 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) + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/BigCatAllOf.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/BigCatAllOf.md new file mode 100644 index 000000000000..7241eb084353 --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/BigCatAllOf.md @@ -0,0 +1,11 @@ +# # 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) + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCat.php new file mode 100644 index 000000000000..8dc2e88283da --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCat.php @@ -0,0 +1,337 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'kind' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes + parent::openAPITypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats + parent::openAPIFormats(); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'kind' => 'kind' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'kind' => 'setKind' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'kind' => 'getKind' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const KIND_LIONS = 'lions'; + const KIND_TIGERS = 'tigers'; + const KIND_LEOPARDS = 'leopards'; + const KIND_JAGUARS = 'jaguars'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getKindAllowableValues() + { + return [ + self::KIND_LIONS, + self::KIND_TIGERS, + self::KIND_LEOPARDS, + self::KIND_JAGUARS, + ]; + } + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + parent::__construct($data); + + $this->container['kind'] = isset($data['kind']) ? $data['kind'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + $allowedValues = $this->getKindAllowableValues(); + if (!is_null($this->container['kind']) && !in_array($this->container['kind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'kind', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets kind + * + * @return string|null + */ + public function getKind() + { + return $this->container['kind']; + } + + /** + * Sets kind + * + * @param string|null $kind kind + * + * @return $this + */ + public function setKind($kind) + { + $allowedValues = $this->getKindAllowableValues(); + if (!is_null($kind) && !in_array($kind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'kind', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['kind'] = $kind; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCatAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCatAllOf.php new file mode 100644 index 000000000000..44fa1674e57a --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/BigCatAllOf.php @@ -0,0 +1,343 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'kind' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'kind' => 'kind' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'kind' => 'setKind' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'kind' => 'getKind' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const KIND_LIONS = 'lions'; + const KIND_TIGERS = 'tigers'; + const KIND_LEOPARDS = 'leopards'; + const KIND_JAGUARS = 'jaguars'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getKindAllowableValues() + { + return [ + self::KIND_LIONS, + self::KIND_TIGERS, + self::KIND_LEOPARDS, + self::KIND_JAGUARS, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['kind'] = isset($data['kind']) ? $data['kind'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getKindAllowableValues(); + if (!is_null($this->container['kind']) && !in_array($this->container['kind'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'kind', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets kind + * + * @return string|null + */ + public function getKind() + { + return $this->container['kind']; + } + + /** + * Sets kind + * + * @param string|null $kind kind + * + * @return $this + */ + public function setKind($kind) + { + $allowedValues = $this->getKindAllowableValues(); + if (!is_null($kind) && !in_array($kind, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'kind', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['kind'] = $kind; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/BigCatAllOfTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/BigCatAllOfTest.php new file mode 100644 index 000000000000..0dffa0380dbf --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/BigCatAllOfTest.php @@ -0,0 +1,87 @@ + :'kind' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'kind' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'BigCatAllOf', + :'Cat' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::BigCat` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::BigCat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + return false unless kind_validator.valid?(@kind) + true && super + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] kind Object to be assigned + def kind=(kind) + validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + unless validator.valid?(kind) + fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." + end + @kind = kind + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + kind == o.kind && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [kind].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat_all_of.rb new file mode 100644 index 000000000000..d2649d0e4534 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/big_cat_all_of.rb @@ -0,0 +1,240 @@ +=begin +#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://openapi-generator.tech +OpenAPI Generator version: 4.2.2-SNAPSHOT + +=end + +require 'date' + +module Petstore + class BigCatAllOf + attr_accessor :kind + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'kind' => :'kind' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'kind' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::BigCatAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::BigCatAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + return false unless kind_validator.valid?(@kind) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] kind Object to be assigned + def kind=(kind) + validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + unless validator.valid?(kind) + fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." + end + @kind = kind + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + kind == o.kind + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [kind].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/big_cat_all_of_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/big_cat_all_of_spec.rb new file mode 100644 index 000000000000..4a547a5ac504 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/big_cat_all_of_spec.rb @@ -0,0 +1,45 @@ +=begin +#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://openapi-generator.tech +OpenAPI Generator version: 4.2.2-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::BigCatAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'BigCatAllOf' do + before do + # run before each test + @instance = Petstore::BigCatAllOf.new + end + + after do + # run after each test + end + + describe 'test an instance of BigCatAllOf' do + it 'should create an instance of BigCatAllOf' do + expect(@instance).to be_instance_of(Petstore::BigCatAllOf) + end + end + describe 'test attribute "kind"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + # validator.allowable_values.each do |value| + # expect { @instance.kind = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/big_cat_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/big_cat_spec.rb new file mode 100644 index 000000000000..c6e0cfbce688 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/big_cat_spec.rb @@ -0,0 +1,45 @@ +=begin +#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://openapi-generator.tech +OpenAPI Generator version: 4.2.2-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::BigCat +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'BigCat' do + before do + # run before each test + @instance = Petstore::BigCat.new + end + + after do + # run after each test + end + + describe 'test an instance of BigCat' do + it 'should create an instance of BigCat' do + expect(@instance).to be_instance_of(Petstore::BigCat) + end + end + describe 'test attribute "kind"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + # validator.allowable_values.each do |value| + # expect { @instance.kind = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index c3cbbb05666f..0e684d1ce3e2 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -129,6 +129,8 @@ Class | Method | HTTP request | Description - [Petstore::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Petstore::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Petstore::ArrayTest](docs/ArrayTest.md) + - [Petstore::BigCat](docs/BigCat.md) + - [Petstore::BigCatAllOf](docs/BigCatAllOf.md) - [Petstore::Capitalization](docs/Capitalization.md) - [Petstore::Cat](docs/Cat.md) - [Petstore::CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/ruby/docs/BigCat.md b/samples/client/petstore/ruby/docs/BigCat.md new file mode 100644 index 000000000000..7c48311d4223 --- /dev/null +++ b/samples/client/petstore/ruby/docs/BigCat.md @@ -0,0 +1,17 @@ +# Petstore::BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::BigCat.new(kind: null) +``` + + diff --git a/samples/client/petstore/ruby/docs/BigCatAllOf.md b/samples/client/petstore/ruby/docs/BigCatAllOf.md new file mode 100644 index 000000000000..101cad0da23b --- /dev/null +++ b/samples/client/petstore/ruby/docs/BigCatAllOf.md @@ -0,0 +1,17 @@ +# Petstore::BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::BigCatAllOf.new(kind: null) +``` + + diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index 6d0a1fac431d..bb459fe96205 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -30,6 +30,8 @@ require 'petstore/models/array_of_array_of_number_only' require 'petstore/models/array_of_number_only' require 'petstore/models/array_test' +require 'petstore/models/big_cat' +require 'petstore/models/big_cat_all_of' require 'petstore/models/capitalization' require 'petstore/models/cat' require 'petstore/models/cat_all_of' diff --git a/samples/client/petstore/ruby/lib/petstore/models/big_cat.rb b/samples/client/petstore/ruby/lib/petstore/models/big_cat.rb new file mode 100644 index 000000000000..46bcc0afa7c4 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/big_cat.rb @@ -0,0 +1,252 @@ +=begin +#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://openapi-generator.tech +OpenAPI Generator version: 4.2.2-SNAPSHOT + +=end + +require 'date' + +module Petstore + class BigCat < Cat + attr_accessor :kind + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'kind' => :'kind' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'kind' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'BigCatAllOf', + :'Cat' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::BigCat` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::BigCat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + return false unless kind_validator.valid?(@kind) + true && super + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] kind Object to be assigned + def kind=(kind) + validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + unless validator.valid?(kind) + fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." + end + @kind = kind + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + kind == o.kind && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [kind].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby/lib/petstore/models/big_cat_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/big_cat_all_of.rb new file mode 100644 index 000000000000..d2649d0e4534 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/big_cat_all_of.rb @@ -0,0 +1,240 @@ +=begin +#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://openapi-generator.tech +OpenAPI Generator version: 4.2.2-SNAPSHOT + +=end + +require 'date' + +module Petstore + class BigCatAllOf + attr_accessor :kind + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'kind' => :'kind' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'kind' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::BigCatAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::BigCatAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + kind_validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + return false unless kind_validator.valid?(@kind) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] kind Object to be assigned + def kind=(kind) + validator = EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + unless validator.valid?(kind) + fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}." + end + @kind = kind + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + kind == o.kind + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [kind].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby/spec/models/big_cat_all_of_spec.rb b/samples/client/petstore/ruby/spec/models/big_cat_all_of_spec.rb new file mode 100644 index 000000000000..4a547a5ac504 --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/big_cat_all_of_spec.rb @@ -0,0 +1,45 @@ +=begin +#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://openapi-generator.tech +OpenAPI Generator version: 4.2.2-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::BigCatAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'BigCatAllOf' do + before do + # run before each test + @instance = Petstore::BigCatAllOf.new + end + + after do + # run after each test + end + + describe 'test an instance of BigCatAllOf' do + it 'should create an instance of BigCatAllOf' do + expect(@instance).to be_instance_of(Petstore::BigCatAllOf) + end + end + describe 'test attribute "kind"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + # validator.allowable_values.each do |value| + # expect { @instance.kind = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/ruby/spec/models/big_cat_spec.rb b/samples/client/petstore/ruby/spec/models/big_cat_spec.rb new file mode 100644 index 000000000000..c6e0cfbce688 --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/big_cat_spec.rb @@ -0,0 +1,45 @@ +=begin +#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://openapi-generator.tech +OpenAPI Generator version: 4.2.2-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::BigCat +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'BigCat' do + before do + # run before each test + @instance = Petstore::BigCat.new + end + + after do + # run after each test + end + + describe 'test an instance of BigCat' do + it 'should create an instance of BigCat' do + expect(@instance).to be_instance_of(Petstore::BigCat) + end + end + describe 'test attribute "kind"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lions", "tigers", "leopards", "jaguars"]) + # validator.allowable_values.each do |value| + # expect { @instance.kind = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/scalaz/project/build.properties b/samples/client/petstore/scalaz/project/build.properties index cf19fd026fd1..64317fdae59f 100644 --- a/samples/client/petstore/scalaz/project/build.properties +++ b/samples/client/petstore/scalaz/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.15 \ No newline at end of file +sbt.version=0.13.15 diff --git a/samples/schema/petstore/mysql/mysql_schema.sql b/samples/schema/petstore/mysql/mysql_schema.sql index e08b704631a6..21145731600d 100644 --- a/samples/schema/petstore/mysql/mysql_schema.sql +++ b/samples/schema/petstore/mysql/mysql_schema.sql @@ -142,6 +142,25 @@ CREATE TABLE IF NOT EXISTS `ArrayTest` ( `array_array_of_model` JSON DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +-- +-- Table structure for table `BigCat` generated from model 'BigCat' +-- + +CREATE TABLE IF NOT EXISTS `BigCat` ( + `className` TEXT NOT NULL, + `color` TEXT, + `declawed` TINYINT(1) DEFAULT NULL, + `kind` ENUM('lions', 'tigers', 'leopards', 'jaguars') DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Table structure for table `BigCat_allOf` generated from model 'BigCatUnderscoreallOf' +-- + +CREATE TABLE IF NOT EXISTS `BigCat_allOf` ( + `kind` ENUM('lions', 'tigers', 'leopards', 'jaguars') DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + -- -- Table structure for table `Capitalization` generated from model 'Capitalization' -- diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..10e898679c91 --- /dev/null +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,113 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; + +/** + * BigCat + */ + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String text) { + for (KindEnum b : KindEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + @JsonProperty("kind") + private KindEnum kind; + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @ApiModelProperty(value = "") + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..ca787eb1f21a --- /dev/null +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,110 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * BigCatAllOf + */ + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String text) { + for (KindEnum b : KindEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + @JsonProperty("kind") + private KindEnum kind; + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @ApiModelProperty(value = "") + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCat.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCat.java new file mode 100644 index 000000000000..0d6ca05971f1 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCat.java @@ -0,0 +1,112 @@ +package apimodels; + +import apimodels.BigCatAllOf; +import apimodels.Cat; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * BigCat + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private final String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("kind") + private KindEnum kind; + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCatAllOf.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCatAllOf.java new file mode 100644 index 000000000000..b0efcc1fc709 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCatAllOf.java @@ -0,0 +1,109 @@ +package apimodels; + +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * BigCatAllOf + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private final String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("kind") + private KindEnum kind; + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json index d3100df48a17..a41ef03feb1b 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json +++ b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json @@ -1934,6 +1934,13 @@ "$ref" : "#/components/schemas/Cat_allOf" } ] }, + "BigCat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Cat" + }, { + "$ref" : "#/components/schemas/BigCat_allOf" + } ] + }, "Animal" : { "discriminator" : { "propertyName" : "className" @@ -2828,6 +2835,14 @@ "type" : "boolean" } } + }, + "BigCat_allOf" : { + "properties" : { + "kind" : { + "enum" : [ "lions", "tigers", "leopards", "jaguars" ], + "type" : "string" + } + } } }, "securitySchemes" : { diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Animal.java index cac03555be3d..1e9de17e4429 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Animal.java @@ -19,6 +19,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..b325b3016b13 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,97 @@ +package org.openapitools.model; + +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class BigCat extends Cat { + +@XmlType(name="KindEnum") +@XmlEnum(String.class) +public enum KindEnum { + +@XmlEnumValue("lions") LIONS(String.valueOf("lions")), @XmlEnumValue("tigers") TIGERS(String.valueOf("tigers")), @XmlEnumValue("leopards") LEOPARDS(String.valueOf("leopards")), @XmlEnumValue("jaguars") JAGUARS(String.valueOf("jaguars")); + + + private String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + @ApiModelProperty(value = "") + private KindEnum kind; + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + public String getKind() { + if (kind == null) { + return null; + } + return kind.value(); + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..be03a0209d2c --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,95 @@ +package org.openapitools.model; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class BigCatAllOf { + +@XmlType(name="KindEnum") +@XmlEnum(String.class) +public enum KindEnum { + +@XmlEnumValue("lions") LIONS(String.valueOf("lions")), @XmlEnumValue("tigers") TIGERS(String.valueOf("tigers")), @XmlEnumValue("leopards") LEOPARDS(String.valueOf("leopards")), @XmlEnumValue("jaguars") JAGUARS(String.valueOf("jaguars")); + + + private String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + @ApiModelProperty(value = "") + private KindEnum kind; + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + public String getKind() { + if (kind == null) { + return null; + } + return kind.value(); + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java index 841c01f67b88..aa2b0ea26b35 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java @@ -36,6 +36,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal implements Serializable { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..45a515a2355a --- /dev/null +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,137 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat implements Serializable { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..adc84d7897a7 --- /dev/null +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,134 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf implements Serializable { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Animal.java index 48269bab57d9..43bfbb7fd24d 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Animal.java @@ -18,6 +18,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..c3c4bfcfb59f --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,113 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class BigCat extends Cat implements Serializable { + + +public enum KindEnum { + + LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); + + + private String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private @Valid KindEnum kind; + + /** + **/ + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("kind") + public KindEnum getKind() { + return kind; + } + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..d3eb97becef2 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,110 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class BigCatAllOf implements Serializable { + + +public enum KindEnum { + + LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); + + + private String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private @Valid KindEnum kind; + + /** + **/ + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("kind") + public KindEnum getKind() { + return kind; + } + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml index ccb16e949adc..79ba65f66eeb 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml @@ -1557,6 +1557,10 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/BigCat_allOf' Animal: discriminator: propertyName: className @@ -2221,6 +2225,15 @@ components: properties: declawed: type: boolean + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Animal.java index 48269bab57d9..43bfbb7fd24d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Animal.java @@ -18,6 +18,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..c3c4bfcfb59f --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,113 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class BigCat extends Cat implements Serializable { + + +public enum KindEnum { + + LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); + + + private String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private @Valid KindEnum kind; + + /** + **/ + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("kind") + public KindEnum getKind() { + return kind; + } + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..d3eb97becef2 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,110 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + + +public class BigCatAllOf implements Serializable { + + +public enum KindEnum { + + LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); + + + private String value; + + KindEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private @Valid KindEnum kind; + + /** + **/ + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("kind") + public KindEnum getKind() { + return kind; + } + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml index ccb16e949adc..79ba65f66eeb 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -1557,6 +1557,10 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/BigCat_allOf' Animal: discriminator: propertyName: className @@ -2221,6 +2225,15 @@ components: properties: declawed: type: boolean + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java index b92746816fe0..f06a0e2b1352 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java @@ -35,6 +35,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..8316a86f8847 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,136 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..e5088ac43df5 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,133 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java index b92746816fe0..f06a0e2b1352 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java @@ -35,6 +35,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..8316a86f8847 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,136 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..e5088ac43df5 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,133 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java index b92746816fe0..f06a0e2b1352 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java @@ -35,6 +35,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..8316a86f8847 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,136 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..e5088ac43df5 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,133 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java index b92746816fe0..f06a0e2b1352 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java @@ -35,6 +35,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) public class Animal { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCat.java new file mode 100644 index 000000000000..8316a86f8847 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCat.java @@ -0,0 +1,136 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.BigCatAllOf; +import org.openapitools.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCatAllOf.java new file mode 100644 index 000000000000..e5088ac43df5 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/BigCatAllOf.java @@ -0,0 +1,133 @@ +/* + * 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 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_KIND = "kind"; + @JsonProperty(JSON_PROPERTY_KIND) + private KindEnum kind; + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @JsonProperty("kind") + @ApiModelProperty(value = "") + + public KindEnum getKind() { + return kind; + } + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/php-slim/README.md b/samples/server/petstore/php-slim/README.md index 0d639b32a11c..8e7f235f0e0b 100644 --- a/samples/server/petstore/php-slim/README.md +++ b/samples/server/petstore/php-slim/README.md @@ -173,6 +173,8 @@ Class | Method | HTTP request | Description * OpenAPIServer\Model\ArrayOfArrayOfNumberOnly * OpenAPIServer\Model\ArrayOfNumberOnly * OpenAPIServer\Model\ArrayTest +* OpenAPIServer\Model\BigCat +* OpenAPIServer\Model\BigCatAllOf * OpenAPIServer\Model\Capitalization * OpenAPIServer\Model\Cat * OpenAPIServer\Model\CatAllOf diff --git a/samples/server/petstore/php-slim/lib/Model/BigCat.php b/samples/server/petstore/php-slim/lib/Model/BigCat.php new file mode 100644 index 000000000000..33cb8342e5aa --- /dev/null +++ b/samples/server/petstore/php-slim/lib/Model/BigCat.php @@ -0,0 +1,39 @@ +