mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-10 23:52:45 +00:00
fix issue when discriminator property is an enum string (#13001)
This commit is contained in:
@@ -22,6 +22,7 @@ public class CodegenDiscriminator {
|
||||
private String propertyGetter;
|
||||
private String propertyType;
|
||||
private Map<String, String> mapping;
|
||||
private boolean isEnum;
|
||||
|
||||
// mappedModels is populated differently if legacyDiscriminatorBehavior is
|
||||
// True or False. When:
|
||||
@@ -88,6 +89,14 @@ public class CodegenDiscriminator {
|
||||
this.mappedModels = mappedModels;
|
||||
}
|
||||
|
||||
public boolean getIsEnum() {
|
||||
return isEnum;
|
||||
}
|
||||
|
||||
public void setIsEnum(boolean isEnum) {
|
||||
this.isEnum = isEnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* An object to hold discriminator mappings between payload values and schema names or
|
||||
* references.
|
||||
|
||||
@@ -3313,8 +3313,19 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
discriminator.setPropertyName(toVarName(discPropName));
|
||||
discriminator.setPropertyBaseName(sourceDiscriminator.getPropertyName());
|
||||
discriminator.setPropertyGetter(toGetter(discriminator.getPropertyName()));
|
||||
|
||||
// FIXME: for now, we assume that the discriminator property is String
|
||||
discriminator.setPropertyType(typeMapping.get("string"));
|
||||
|
||||
// check to see if the discriminator property is an enum string
|
||||
if (schema.getProperties() != null &&
|
||||
schema.getProperties().get(discPropName) instanceof StringSchema) {
|
||||
StringSchema s = (StringSchema) schema.getProperties().get(discPropName);
|
||||
if (s.getEnum() != null && !s.getEnum().isEmpty()) { // it's an enum string
|
||||
discriminator.setIsEnum(true);
|
||||
}
|
||||
}
|
||||
|
||||
discriminator.setMapping(sourceDiscriminator.getMapping());
|
||||
List<MappedModel> uniqueDescendants = new ArrayList<>();
|
||||
if (sourceDiscriminator.getMapping() != null && !sourceDiscriminator.getMapping().isEmpty()) {
|
||||
|
||||
@@ -105,10 +105,22 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{/vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
|
||||
{{/vars}}
|
||||
public {{classname}}() { {{#parent}}{{#parcelableModel}}
|
||||
super();{{/parcelableModel}}{{/parent}}{{#gson}}{{#discriminator}}
|
||||
this.{{{discriminatorName}}} = this.getClass().getSimpleName();{{/discriminator}}{{/gson}}
|
||||
}{{#vendorExtensions.x-has-readonly-properties}}{{^withXml}}
|
||||
public {{classname}}() {
|
||||
{{#parent}}
|
||||
{{#parcelableModel}}
|
||||
super();
|
||||
{{/parcelableModel}}
|
||||
{{/parent}}
|
||||
{{#gson}}
|
||||
{{#discriminator}}
|
||||
{{^discriminator.isEnum}}
|
||||
this.{{{discriminatorName}}} = this.getClass().getSimpleName();
|
||||
{{/discriminator.isEnum}}
|
||||
{{/discriminator}}
|
||||
{{/gson}}
|
||||
}
|
||||
{{#vendorExtensions.x-has-readonly-properties}}
|
||||
{{^withXml}}
|
||||
|
||||
{{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}}
|
||||
public {{classname}}(
|
||||
@@ -120,7 +132,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{#readOnlyVars}}
|
||||
this.{{name}} = {{name}};
|
||||
{{/readOnlyVars}}
|
||||
}{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}}
|
||||
}
|
||||
{{/withXml}}
|
||||
{{/vendorExtensions.x-has-readonly-properties}}
|
||||
{{#vars}}
|
||||
|
||||
{{^isReadOnly}}
|
||||
|
||||
@@ -88,10 +88,21 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{/vendorExtensions.x-is-jackson-optional-nullable}}
|
||||
|
||||
{{/vars}}
|
||||
public {{classname}}() { {{#parent}}{{#parcelableModel}}
|
||||
super();{{/parcelableModel}}{{/parent}}{{#gson}}{{#discriminator}}
|
||||
this.{{{discriminatorName}}} = this.getClass().getSimpleName();{{/discriminator}}{{/gson}}
|
||||
}{{#vendorExtensions.x-has-readonly-properties}}{{^withXml}}
|
||||
public {{classname}}() {
|
||||
{{#parent}}
|
||||
{{#parcelableModel}}
|
||||
super();{{/parcelableModel}}
|
||||
{{/parent}}
|
||||
{{#gson}}
|
||||
{{#discriminator}}
|
||||
{{#discriminator.isEnum}}
|
||||
this.{{{discriminatorName}}} = this.getClass().getSimpleName();
|
||||
{{/discriminator.isEnum}}
|
||||
{{/discriminator}}
|
||||
{{/gson}}
|
||||
}
|
||||
{{#vendorExtensions.x-has-readonly-properties}}
|
||||
{{^withXml}}
|
||||
|
||||
{{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}}
|
||||
public {{classname}}(
|
||||
@@ -103,7 +114,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{#readOnlyVars}}
|
||||
this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}};
|
||||
{{/readOnlyVars}}
|
||||
}{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}}
|
||||
}
|
||||
{{/withXml}}
|
||||
{{/vendorExtensions.x-has-readonly-properties}}
|
||||
{{#vars}}
|
||||
|
||||
{{^isReadOnly}}
|
||||
|
||||
@@ -2205,3 +2205,17 @@ components:
|
||||
properties:
|
||||
color:
|
||||
type: string
|
||||
EnumStringDiscriminator:
|
||||
type: object
|
||||
description: An object to test discriminator of enum string
|
||||
discriminator:
|
||||
propertyName: enum_str_type
|
||||
required:
|
||||
- enum_str_type
|
||||
properties:
|
||||
enum_str_type:
|
||||
description: enum string type
|
||||
type: string
|
||||
enum:
|
||||
- type_a
|
||||
- type_b
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesAnyType extends HashMap<String, Object> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesAnyType() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesAnyType name(String name) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class AdditionalPropertiesArray extends HashMap<String, List> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesArray() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesArray name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesBoolean extends HashMap<String, Boolean> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesBoolean() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesBoolean name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesInteger extends HashMap<String, Integer> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesInteger() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesInteger name(String name) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class AdditionalPropertiesNumber extends HashMap<String, BigDecimal> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesNumber() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesNumber name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesObject extends HashMap<String, Map> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesObject() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesObject name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesString extends HashMap<String, String> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesString() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesString name(String name) {
|
||||
|
||||
@@ -86,6 +86,7 @@ public class BigCat extends Cat {
|
||||
private KindEnum kind;
|
||||
|
||||
public BigCat() {
|
||||
|
||||
}
|
||||
|
||||
public BigCat kind(KindEnum kind) {
|
||||
|
||||
@@ -51,6 +51,7 @@ public class Cat extends Animal {
|
||||
private Boolean declawed;
|
||||
|
||||
public Cat() {
|
||||
|
||||
}
|
||||
|
||||
public Cat declawed(Boolean declawed) {
|
||||
|
||||
@@ -47,6 +47,7 @@ public class Dog extends Animal {
|
||||
private String breed;
|
||||
|
||||
public Dog() {
|
||||
|
||||
}
|
||||
|
||||
public Dog breed(String breed) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class AdditionalPropertiesAnyType extends HashMap<String, Object> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesAnyType() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesAnyType name(String name) {
|
||||
|
||||
@@ -41,6 +41,7 @@ public class AdditionalPropertiesArray extends HashMap<String, List> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesArray() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesArray name(String name) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class AdditionalPropertiesBoolean extends HashMap<String, Boolean> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesBoolean() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesBoolean name(String name) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class AdditionalPropertiesInteger extends HashMap<String, Integer> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesInteger() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesInteger name(String name) {
|
||||
|
||||
@@ -41,6 +41,7 @@ public class AdditionalPropertiesNumber extends HashMap<String, BigDecimal> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesNumber() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesNumber name(String name) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class AdditionalPropertiesObject extends HashMap<String, Map> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesObject() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesObject name(String name) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class AdditionalPropertiesString extends HashMap<String, String> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesString() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesString name(String name) {
|
||||
|
||||
@@ -87,6 +87,7 @@ public class BigCat extends Cat {
|
||||
private KindEnum kind;
|
||||
|
||||
public BigCat() {
|
||||
|
||||
}
|
||||
|
||||
public BigCat kind(KindEnum kind) {
|
||||
|
||||
@@ -52,6 +52,7 @@ public class Cat extends Animal {
|
||||
private Boolean declawed;
|
||||
|
||||
public Cat() {
|
||||
|
||||
}
|
||||
|
||||
public Cat declawed(Boolean declawed) {
|
||||
|
||||
@@ -48,6 +48,7 @@ public class Dog extends Animal {
|
||||
private String breed;
|
||||
|
||||
public Dog() {
|
||||
|
||||
}
|
||||
|
||||
public Dog breed(String breed) {
|
||||
|
||||
@@ -47,6 +47,7 @@ public class Cat extends Animal {
|
||||
private Boolean declawed;
|
||||
|
||||
public Cat() {
|
||||
|
||||
}
|
||||
|
||||
public Cat declawed(Boolean declawed) {
|
||||
|
||||
@@ -47,6 +47,7 @@ public class Dog extends Animal {
|
||||
private String breed;
|
||||
|
||||
public Dog() {
|
||||
|
||||
}
|
||||
|
||||
public Dog breed(String breed) {
|
||||
|
||||
@@ -92,6 +92,7 @@ public class NullableClass extends HashMap<String, Object> {
|
||||
private Map<String, Object> objectItemsNullable = null;
|
||||
|
||||
public NullableClass() {
|
||||
|
||||
}
|
||||
|
||||
public NullableClass integerProp(Integer integerProp) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesAnyType extends HashMap<String, Object> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesAnyType() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesAnyType name(String name) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class AdditionalPropertiesArray extends HashMap<String, List> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesArray() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesArray name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesBoolean extends HashMap<String, Boolean> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesBoolean() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesBoolean name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesInteger extends HashMap<String, Integer> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesInteger() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesInteger name(String name) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class AdditionalPropertiesNumber extends HashMap<String, BigDecimal> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesNumber() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesNumber name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesObject extends HashMap<String, Map> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesObject() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesObject name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesString extends HashMap<String, String> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesString() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesString name(String name) {
|
||||
|
||||
@@ -86,6 +86,7 @@ public class BigCat extends Cat {
|
||||
private KindEnum kind;
|
||||
|
||||
public BigCat() {
|
||||
|
||||
}
|
||||
|
||||
public BigCat kind(KindEnum kind) {
|
||||
|
||||
@@ -51,6 +51,7 @@ public class Cat extends Animal {
|
||||
private Boolean declawed;
|
||||
|
||||
public Cat() {
|
||||
|
||||
}
|
||||
|
||||
public Cat declawed(Boolean declawed) {
|
||||
|
||||
@@ -47,6 +47,7 @@ public class Dog extends Animal {
|
||||
private String breed;
|
||||
|
||||
public Dog() {
|
||||
|
||||
}
|
||||
|
||||
public Dog breed(String breed) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesAnyType extends HashMap<String, Object> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesAnyType() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesAnyType name(String name) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class AdditionalPropertiesArray extends HashMap<String, List> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesArray() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesArray name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesBoolean extends HashMap<String, Boolean> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesBoolean() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesBoolean name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesInteger extends HashMap<String, Integer> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesInteger() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesInteger name(String name) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class AdditionalPropertiesNumber extends HashMap<String, BigDecimal> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesNumber() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesNumber name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesObject extends HashMap<String, Map> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesObject() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesObject name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesString extends HashMap<String, String> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesString() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesString name(String name) {
|
||||
|
||||
@@ -86,6 +86,7 @@ public class BigCat extends Cat {
|
||||
private KindEnum kind;
|
||||
|
||||
public BigCat() {
|
||||
|
||||
}
|
||||
|
||||
public BigCat kind(KindEnum kind) {
|
||||
|
||||
@@ -51,6 +51,7 @@ public class Cat extends Animal {
|
||||
private Boolean declawed;
|
||||
|
||||
public Cat() {
|
||||
|
||||
}
|
||||
|
||||
public Cat declawed(Boolean declawed) {
|
||||
|
||||
@@ -47,6 +47,7 @@ public class Dog extends Animal {
|
||||
private String breed;
|
||||
|
||||
public Dog() {
|
||||
|
||||
}
|
||||
|
||||
public Dog breed(String breed) {
|
||||
|
||||
@@ -34,6 +34,7 @@ docs/DogAllOf.md
|
||||
docs/Drawing.md
|
||||
docs/EnumArrays.md
|
||||
docs/EnumClass.md
|
||||
docs/EnumStringDiscriminator.md
|
||||
docs/EnumTest.md
|
||||
docs/EquilateralTriangle.md
|
||||
docs/FakeApi.md
|
||||
@@ -155,6 +156,7 @@ src/main/java/org/openapitools/client/model/DogAllOf.java
|
||||
src/main/java/org/openapitools/client/model/Drawing.java
|
||||
src/main/java/org/openapitools/client/model/EnumArrays.java
|
||||
src/main/java/org/openapitools/client/model/EnumClass.java
|
||||
src/main/java/org/openapitools/client/model/EnumStringDiscriminator.java
|
||||
src/main/java/org/openapitools/client/model/EnumTest.java
|
||||
src/main/java/org/openapitools/client/model/EquilateralTriangle.java
|
||||
src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
|
||||
|
||||
@@ -183,6 +183,7 @@ Class | Method | HTTP request | Description
|
||||
- [Drawing](docs/Drawing.md)
|
||||
- [EnumArrays](docs/EnumArrays.md)
|
||||
- [EnumClass](docs/EnumClass.md)
|
||||
- [EnumStringDiscriminator](docs/EnumStringDiscriminator.md)
|
||||
- [EnumTest](docs/EnumTest.md)
|
||||
- [EquilateralTriangle](docs/EquilateralTriangle.md)
|
||||
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
|
||||
|
||||
@@ -2186,6 +2186,20 @@ components:
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
EnumStringDiscriminator:
|
||||
description: An object to test discriminator of enum string
|
||||
discriminator:
|
||||
propertyName: enum_str_type
|
||||
properties:
|
||||
enum_str_type:
|
||||
description: enum string type
|
||||
enum:
|
||||
- type_a
|
||||
- type_b
|
||||
type: string
|
||||
required:
|
||||
- enum_str_type
|
||||
type: object
|
||||
_foo_get_default_response:
|
||||
example:
|
||||
string:
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
# EnumStringDiscriminator
|
||||
|
||||
An object to test discriminator of enum string
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**enumStrType** | [**EnumStrTypeEnum**](#EnumStrTypeEnum) | enum string type | |
|
||||
|
||||
|
||||
|
||||
## Enum: EnumStrTypeEnum
|
||||
|
||||
| Name | Value |
|
||||
|---- | -----|
|
||||
| A | "type_a" |
|
||||
| B | "type_b" |
|
||||
|
||||
|
||||
|
||||
@@ -86,6 +86,15 @@ public class JSON {
|
||||
return getClassByDiscriminator(classByDiscriminatorValue,
|
||||
getDiscriminatorValue(readElement, "className"));
|
||||
}
|
||||
})
|
||||
.registerTypeSelector(org.openapitools.client.model.EnumStringDiscriminator.class, new TypeSelector<org.openapitools.client.model.EnumStringDiscriminator>() {
|
||||
@Override
|
||||
public Class<? extends org.openapitools.client.model.EnumStringDiscriminator> getClassForElement(JsonElement readElement) {
|
||||
Map<String, Class> classByDiscriminatorValue = new HashMap<String, Class>();
|
||||
classByDiscriminatorValue.put("EnumStringDiscriminator", org.openapitools.client.model.EnumStringDiscriminator.class);
|
||||
return getClassByDiscriminator(classByDiscriminatorValue,
|
||||
getDiscriminatorValue(readElement, "enum_str_type"));
|
||||
}
|
||||
})
|
||||
.registerTypeSelector(org.openapitools.client.model.GrandparentAnimal.class, new TypeSelector<org.openapitools.client.model.GrandparentAnimal>() {
|
||||
@Override
|
||||
@@ -245,6 +254,7 @@ public class JSON {
|
||||
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DogAllOf.CustomTypeAdapterFactory());
|
||||
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Drawing.CustomTypeAdapterFactory());
|
||||
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.EnumArrays.CustomTypeAdapterFactory());
|
||||
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.EnumStringDiscriminator.CustomTypeAdapterFactory());
|
||||
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.EnumTest.CustomTypeAdapterFactory());
|
||||
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.EquilateralTriangle.CustomTypeAdapterFactory());
|
||||
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.FileSchemaTestClass.CustomTypeAdapterFactory());
|
||||
|
||||
@@ -0,0 +1,326 @@
|
||||
/*
|
||||
* 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 com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.google.gson.TypeAdapterFactory;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* An object to test discriminator of enum string
|
||||
*/
|
||||
@ApiModel(description = "An object to test discriminator of enum string")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class EnumStringDiscriminator {
|
||||
/**
|
||||
* enum string type
|
||||
*/
|
||||
@JsonAdapter(EnumStrTypeEnum.Adapter.class)
|
||||
public enum EnumStrTypeEnum {
|
||||
A("type_a"),
|
||||
|
||||
B("type_b");
|
||||
|
||||
private String value;
|
||||
|
||||
EnumStrTypeEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
public static EnumStrTypeEnum fromValue(String value) {
|
||||
for (EnumStrTypeEnum b : EnumStrTypeEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
|
||||
public static class Adapter extends TypeAdapter<EnumStrTypeEnum> {
|
||||
@Override
|
||||
public void write(final JsonWriter jsonWriter, final EnumStrTypeEnum enumeration) throws IOException {
|
||||
jsonWriter.value(enumeration.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumStrTypeEnum read(final JsonReader jsonReader) throws IOException {
|
||||
String value = jsonReader.nextString();
|
||||
return EnumStrTypeEnum.fromValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final String SERIALIZED_NAME_ENUM_STR_TYPE = "enum_str_type";
|
||||
@SerializedName(SERIALIZED_NAME_ENUM_STR_TYPE)
|
||||
protected EnumStrTypeEnum enumStrType;
|
||||
|
||||
public EnumStringDiscriminator() {
|
||||
}
|
||||
|
||||
public EnumStringDiscriminator enumStrType(EnumStrTypeEnum enumStrType) {
|
||||
|
||||
this.enumStrType = enumStrType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* enum string type
|
||||
* @return enumStrType
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(required = true, value = "enum string type")
|
||||
|
||||
public EnumStrTypeEnum getEnumStrType() {
|
||||
return enumStrType;
|
||||
}
|
||||
|
||||
|
||||
public void setEnumStrType(EnumStrTypeEnum enumStrType) {
|
||||
this.enumStrType = enumStrType;
|
||||
}
|
||||
|
||||
/**
|
||||
* A container for additional, undeclared properties.
|
||||
* This is a holder for any undeclared properties as specified with
|
||||
* the 'additionalProperties' keyword in the OAS document.
|
||||
*/
|
||||
private Map<String, Object> additionalProperties;
|
||||
|
||||
/**
|
||||
* Set the additional (undeclared) property with the specified name and value.
|
||||
* If the property does not already exist, create it otherwise replace it.
|
||||
*/
|
||||
public EnumStringDiscriminator putAdditionalProperty(String key, Object value) {
|
||||
if (this.additionalProperties == null) {
|
||||
this.additionalProperties = new HashMap<String, Object>();
|
||||
}
|
||||
this.additionalProperties.put(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the additional (undeclared) property.
|
||||
*/
|
||||
public Map<String, Object> getAdditionalProperties() {
|
||||
return additionalProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the additional (undeclared) property with the specified name.
|
||||
*/
|
||||
public Object getAdditionalProperty(String key) {
|
||||
if (this.additionalProperties == null) {
|
||||
return null;
|
||||
}
|
||||
return this.additionalProperties.get(key);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
EnumStringDiscriminator enumStringDiscriminator = (EnumStringDiscriminator) o;
|
||||
return Objects.equals(this.enumStrType, enumStringDiscriminator.enumStrType)&&
|
||||
Objects.equals(this.additionalProperties, enumStringDiscriminator.additionalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(enumStrType, additionalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class EnumStringDiscriminator {\n");
|
||||
sb.append(" enumStrType: ").append(toIndentedString(enumStrType)).append("\n");
|
||||
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
static {
|
||||
// a set of all properties/fields (JSON key names)
|
||||
openapiFields = new HashSet<String>();
|
||||
openapiFields.add("enum_str_type");
|
||||
|
||||
// a set of required properties/fields (JSON key names)
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
openapiRequiredFields.add("enum_str_type");
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to EnumStringDiscriminator
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (EnumStringDiscriminator.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has required fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in EnumStringDiscriminator is not found in the empty JSON string", EnumStringDiscriminator.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : EnumStringDiscriminator.openapiRequiredFields) {
|
||||
if (jsonObj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
|
||||
if (!EnumStringDiscriminator.class.isAssignableFrom(type.getRawType())) {
|
||||
return null; // this class only serializes 'EnumStringDiscriminator' and its subtypes
|
||||
}
|
||||
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
|
||||
final TypeAdapter<EnumStringDiscriminator> thisAdapter
|
||||
= gson.getDelegateAdapter(this, TypeToken.get(EnumStringDiscriminator.class));
|
||||
|
||||
return (TypeAdapter<T>) new TypeAdapter<EnumStringDiscriminator>() {
|
||||
@Override
|
||||
public void write(JsonWriter out, EnumStringDiscriminator value) throws IOException {
|
||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
||||
obj.remove("additionalProperties");
|
||||
// serialize additonal properties
|
||||
if (value.getAdditionalProperties() != null) {
|
||||
for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) {
|
||||
if (entry.getValue() instanceof String)
|
||||
obj.addProperty(entry.getKey(), (String) entry.getValue());
|
||||
else if (entry.getValue() instanceof Number)
|
||||
obj.addProperty(entry.getKey(), (Number) entry.getValue());
|
||||
else if (entry.getValue() instanceof Boolean)
|
||||
obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
|
||||
else if (entry.getValue() instanceof Character)
|
||||
obj.addProperty(entry.getKey(), (Character) entry.getValue());
|
||||
else {
|
||||
obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
|
||||
}
|
||||
}
|
||||
}
|
||||
elementAdapter.write(out, obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumStringDiscriminator read(JsonReader in) throws IOException {
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
// store additional fields in the deserialized instance
|
||||
EnumStringDiscriminator instance = thisAdapter.fromJsonTree(jsonObj);
|
||||
for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) {
|
||||
if (!openapiFields.contains(entry.getKey())) {
|
||||
if (entry.getValue().isJsonPrimitive()) { // primitive type
|
||||
if (entry.getValue().getAsJsonPrimitive().isString())
|
||||
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
|
||||
else if (entry.getValue().getAsJsonPrimitive().isNumber())
|
||||
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
|
||||
else if (entry.getValue().getAsJsonPrimitive().isBoolean())
|
||||
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
|
||||
else
|
||||
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
|
||||
} else { // non-primitive type
|
||||
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of EnumStringDiscriminator given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of EnumStringDiscriminator
|
||||
* @throws IOException if the JSON string is invalid with respect to EnumStringDiscriminator
|
||||
*/
|
||||
public static EnumStringDiscriminator fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, EnumStringDiscriminator.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of EnumStringDiscriminator to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 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.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for EnumStringDiscriminator
|
||||
*/
|
||||
public class EnumStringDiscriminatorTest {
|
||||
private final EnumStringDiscriminator model = new EnumStringDiscriminator();
|
||||
|
||||
/**
|
||||
* Model tests for EnumStringDiscriminator
|
||||
*/
|
||||
@Test
|
||||
public void testEnumStringDiscriminator() {
|
||||
// TODO: test EnumStringDiscriminator
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'enumStrType'
|
||||
*/
|
||||
@Test
|
||||
public void enumStrTypeTest() {
|
||||
// TODO: test enumStrType
|
||||
}
|
||||
|
||||
}
|
||||
@@ -42,6 +42,7 @@ public class AdditionalPropertiesAnyType extends HashMap<String, Object> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesAnyType() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesAnyType name(String name) {
|
||||
|
||||
@@ -43,6 +43,7 @@ public class AdditionalPropertiesArray extends HashMap<String, List> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesArray() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesArray name(String name) {
|
||||
|
||||
@@ -42,6 +42,7 @@ public class AdditionalPropertiesBoolean extends HashMap<String, Boolean> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesBoolean() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesBoolean name(String name) {
|
||||
|
||||
@@ -42,6 +42,7 @@ public class AdditionalPropertiesInteger extends HashMap<String, Integer> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesInteger() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesInteger name(String name) {
|
||||
|
||||
@@ -43,6 +43,7 @@ public class AdditionalPropertiesNumber extends HashMap<String, BigDecimal> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesNumber() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesNumber name(String name) {
|
||||
|
||||
@@ -42,6 +42,7 @@ public class AdditionalPropertiesObject extends HashMap<String, Map> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesObject() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesObject name(String name) {
|
||||
|
||||
@@ -42,6 +42,7 @@ public class AdditionalPropertiesString extends HashMap<String, String> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesString() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesString name(String name) {
|
||||
|
||||
@@ -89,6 +89,7 @@ public class BigCat extends Cat {
|
||||
private KindEnum kind;
|
||||
|
||||
public BigCat() {
|
||||
|
||||
}
|
||||
|
||||
public BigCat kind(KindEnum kind) {
|
||||
|
||||
@@ -54,6 +54,7 @@ public class Cat extends Animal {
|
||||
private Boolean declawed;
|
||||
|
||||
public Cat() {
|
||||
|
||||
}
|
||||
|
||||
public Cat declawed(Boolean declawed) {
|
||||
|
||||
@@ -50,6 +50,7 @@ public class Dog extends Animal {
|
||||
private String breed;
|
||||
|
||||
public Dog() {
|
||||
|
||||
}
|
||||
|
||||
public Dog breed(String breed) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesAnyType extends HashMap<String, Object> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesAnyType() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesAnyType name(String name) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class AdditionalPropertiesArray extends HashMap<String, List> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesArray() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesArray name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesBoolean extends HashMap<String, Boolean> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesBoolean() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesBoolean name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesInteger extends HashMap<String, Integer> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesInteger() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesInteger name(String name) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class AdditionalPropertiesNumber extends HashMap<String, BigDecimal> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesNumber() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesNumber name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesObject extends HashMap<String, Map> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesObject() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesObject name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesString extends HashMap<String, String> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesString() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesString name(String name) {
|
||||
|
||||
@@ -44,7 +44,6 @@ public class Animal {
|
||||
private String color = "red";
|
||||
|
||||
public Animal() {
|
||||
this.className = this.getClass().getSimpleName();
|
||||
}
|
||||
|
||||
public Animal className(String className) {
|
||||
|
||||
@@ -89,7 +89,7 @@ public class BigCat extends Cat {
|
||||
private KindEnum kind;
|
||||
|
||||
public BigCat() {
|
||||
this.className = this.getClass().getSimpleName();
|
||||
|
||||
}
|
||||
|
||||
public BigCat kind(KindEnum kind) {
|
||||
|
||||
@@ -39,7 +39,7 @@ public class Cat extends Animal {
|
||||
private Boolean declawed;
|
||||
|
||||
public Cat() {
|
||||
this.className = this.getClass().getSimpleName();
|
||||
|
||||
}
|
||||
|
||||
public Cat declawed(Boolean declawed) {
|
||||
|
||||
@@ -38,7 +38,7 @@ public class Dog extends Animal {
|
||||
private String breed;
|
||||
|
||||
public Dog() {
|
||||
this.className = this.getClass().getSimpleName();
|
||||
|
||||
}
|
||||
|
||||
public Dog breed(String breed) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesAnyType extends HashMap<String, Object> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesAnyType() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesAnyType name(String name) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class AdditionalPropertiesArray extends HashMap<String, List> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesArray() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesArray name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesBoolean extends HashMap<String, Boolean> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesBoolean() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesBoolean name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesInteger extends HashMap<String, Integer> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesInteger() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesInteger name(String name) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class AdditionalPropertiesNumber extends HashMap<String, BigDecimal> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesNumber() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesNumber name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesObject extends HashMap<String, Map> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesObject() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesObject name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesString extends HashMap<String, String> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesString() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesString name(String name) {
|
||||
|
||||
@@ -86,6 +86,7 @@ public class BigCat extends Cat {
|
||||
private KindEnum kind;
|
||||
|
||||
public BigCat() {
|
||||
|
||||
}
|
||||
|
||||
public BigCat kind(KindEnum kind) {
|
||||
|
||||
@@ -51,6 +51,7 @@ public class Cat extends Animal {
|
||||
private Boolean declawed;
|
||||
|
||||
public Cat() {
|
||||
|
||||
}
|
||||
|
||||
public Cat declawed(Boolean declawed) {
|
||||
|
||||
@@ -47,6 +47,7 @@ public class Dog extends Animal {
|
||||
private String breed;
|
||||
|
||||
public Dog() {
|
||||
|
||||
}
|
||||
|
||||
public Dog breed(String breed) {
|
||||
|
||||
@@ -47,6 +47,7 @@ public class AdditionalPropertiesAnyType extends HashMap<String, Object> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesAnyType() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesAnyType name(String name) {
|
||||
|
||||
@@ -48,6 +48,7 @@ public class AdditionalPropertiesArray extends HashMap<String, List> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesArray() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesArray name(String name) {
|
||||
|
||||
@@ -47,6 +47,7 @@ public class AdditionalPropertiesBoolean extends HashMap<String, Boolean> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesBoolean() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesBoolean name(String name) {
|
||||
|
||||
@@ -47,6 +47,7 @@ public class AdditionalPropertiesInteger extends HashMap<String, Integer> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesInteger() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesInteger name(String name) {
|
||||
|
||||
@@ -48,6 +48,7 @@ public class AdditionalPropertiesNumber extends HashMap<String, BigDecimal> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesNumber() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesNumber name(String name) {
|
||||
|
||||
@@ -47,6 +47,7 @@ public class AdditionalPropertiesObject extends HashMap<String, Map> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesObject() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesObject name(String name) {
|
||||
|
||||
@@ -47,6 +47,7 @@ public class AdditionalPropertiesString extends HashMap<String, String> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesString() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesString name(String name) {
|
||||
|
||||
@@ -100,6 +100,7 @@ public class BigCat extends Cat {
|
||||
private KindEnum kind;
|
||||
|
||||
public BigCat() {
|
||||
|
||||
}
|
||||
|
||||
public BigCat kind(KindEnum kind) {
|
||||
|
||||
@@ -59,6 +59,7 @@ public class Cat extends Animal {
|
||||
private Boolean declawed;
|
||||
|
||||
public Cat() {
|
||||
|
||||
}
|
||||
|
||||
public Cat declawed(Boolean declawed) {
|
||||
|
||||
@@ -55,6 +55,7 @@ public class Dog extends Animal {
|
||||
private String breed;
|
||||
|
||||
public Dog() {
|
||||
|
||||
}
|
||||
|
||||
public Dog breed(String breed) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesAnyType extends HashMap<String, Object> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesAnyType() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesAnyType name(String name) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class AdditionalPropertiesArray extends HashMap<String, List> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesArray() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesArray name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesBoolean extends HashMap<String, Boolean> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesBoolean() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesBoolean name(String name) {
|
||||
|
||||
@@ -39,6 +39,7 @@ public class AdditionalPropertiesInteger extends HashMap<String, Integer> {
|
||||
private String name;
|
||||
|
||||
public AdditionalPropertiesInteger() {
|
||||
|
||||
}
|
||||
|
||||
public AdditionalPropertiesInteger name(String name) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user