[Default] update isAdditionalPropertiesTrue tag to cover more types (#16227)

* enhance additional properties support

* update samples

* update tests

* add more tests

* update samples

* fix samples
This commit is contained in:
William Cheng 2023-08-05 13:32:43 +08:00 committed by GitHub
parent c080660cc1
commit f6fb83878b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
142 changed files with 2965 additions and 332 deletions

View File

@ -149,7 +149,10 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
public String additionalPropertiesType;
/**
* True if additionalProperties is set to true (boolean value)
* True if additionalProperties is set to true (boolean value), any type, free form object, etc
*
* TODO: we may rename this to isAdditionalPropertiesEnabled or something
* else to avoid confusions
*/
public boolean isAdditionalPropertiesTrue;
@ -1088,6 +1091,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
Objects.equals(externalDocumentation, that.externalDocumentation) &&
Objects.equals(vendorExtensions, that.vendorExtensions) &&
Objects.equals(additionalPropertiesType, that.additionalPropertiesType) &&
Objects.equals(isAdditionalPropertiesTrue, that.isAdditionalPropertiesTrue) &&
Objects.equals(getMaxProperties(), that.getMaxProperties()) &&
Objects.equals(getMinProperties(), that.getMinProperties()) &&
Objects.equals(getMaxItems(), that.getMaxItems()) &&
@ -1193,6 +1197,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
sb.append(", externalDocumentation=").append(externalDocumentation);
sb.append(", vendorExtensions=").append(vendorExtensions);
sb.append(", additionalPropertiesType='").append(additionalPropertiesType).append('\'');
sb.append(", isAdditionalPropertiesTrue='").append(isAdditionalPropertiesTrue).append('\'');
sb.append(", maxProperties=").append(maxProperties);
sb.append(", minProperties=").append(minProperties);
sb.append(", uniqueItems=").append(uniqueItems);

View File

@ -3179,6 +3179,9 @@ public class DefaultCodegen implements CodegenConfig {
// if we are trying to set additionalProperties on an empty schema stop recursing
return;
}
// Note: This flag is set to true if additioanl properties
// is set (any type, free form object, boolean true, string, etc).
// The variable name may be renamed later to avoid confusion.
boolean additionalPropertiesIsAnyType = false;
CodegenModel m = null;
if (property instanceof CodegenModel) {
@ -3199,15 +3202,14 @@ public class DefaultCodegen implements CodegenConfig {
additionalPropertiesIsAnyType = true;
}
} else {
// if additioanl properties is set (e.g. free form object, any type, string, etc)
addPropProp = fromProperty(getAdditionalPropertiesName(), (Schema) schema.getAdditionalProperties(), false);
if (ModelUtils.isAnyType((Schema) schema.getAdditionalProperties())) {
additionalPropertiesIsAnyType = true;
}
}
if (additionalPropertiesIsAnyType) {
property.setAdditionalPropertiesIsAnyType(true);
}
if (m != null && isAdditionalPropertiesTrue) {
if (m != null && (isAdditionalPropertiesTrue || additionalPropertiesIsAnyType)) {
m.isAdditionalPropertiesTrue = true;
}
if (ModelUtils.isComposedSchema(schema) && !supportsAdditionalPropertiesWithComposedSchema) {

View File

@ -2616,7 +2616,7 @@ public class DefaultCodegenTest {
cm = codegen.fromModel(modelName, sc);
CodegenProperty stringCp = codegen.fromProperty("additional_properties", new Schema().type("string"));
assertEquals(cm.getAdditionalProperties(), stringCp);
assertFalse(cm.getAdditionalPropertiesIsAnyType());
assertTrue(cm.getAdditionalPropertiesIsAnyType());
}
@Test
@ -2656,7 +2656,7 @@ public class DefaultCodegenTest {
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
mapWithAddPropsSchema = cm.getVars().get(3);
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
assertTrue(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
modelName = "ObjectModelWithAddPropsInProps";
sc = openAPI.getComponents().getSchemas().get(modelName);
@ -2672,7 +2672,7 @@ public class DefaultCodegenTest {
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
mapWithAddPropsSchema = cm.getVars().get(3);
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
assertTrue(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
if (isGenerateAliasAsModel) { // restore the setting
GlobalSettings.setProperty("generateAliasAsModel", "true");
@ -2717,7 +2717,7 @@ public class DefaultCodegenTest {
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
mapWithAddPropsSchema = co.queryParams.get(3);
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
assertTrue(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
path = "/additional_properties/";
operation = openAPI.getPaths().get(path).getPost();
@ -2733,7 +2733,7 @@ public class DefaultCodegenTest {
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
mapWithAddPropsSchema = co.queryParams.get(3);
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
assertTrue(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
if (isGenerateAliasAsModel) { // restore the setting
GlobalSettings.setProperty("generateAliasAsModel", "true");
@ -2778,7 +2778,7 @@ public class DefaultCodegenTest {
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
mapWithAddPropsSchema = co.responses.get(3);
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
assertTrue(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
path = "/additional_properties/";
operation = openAPI.getPaths().get(path).getPost();
@ -2794,7 +2794,7 @@ public class DefaultCodegenTest {
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
mapWithAddPropsSchema = co.responses.get(3);
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
assertTrue(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
if (isGenerateAliasAsModel) { // restore the setting
GlobalSettings.setProperty("generateAliasAsModel", "true");

View File

@ -2272,4 +2272,23 @@ components:
properties:
skill:
type: string
AdditionalPropertiesObject:
type: object
properties:
name:
type: string
additionalProperties:
type: object
AdditionalPropertiesAnyType:
type: object
properties:
name:
type: string
additionalProperties: {}
AdditionalPropertiesWithDescriptionOnly:
type: object
properties:
name:
type: string
additionalProperties:
description: This is what the additional property is

View File

@ -61,6 +61,7 @@ namespace Org.OpenAPITools.Model
{
this._flagShapes = true;
}
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@ -159,6 +160,12 @@ namespace Org.OpenAPITools.Model
{
return _flagShapes;
}
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -172,6 +179,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -230,6 +238,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}

View File

@ -109,6 +109,7 @@ namespace Org.OpenAPITools.Model
{
this._flagObjectItemsNullable = true;
}
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@ -400,6 +401,12 @@ namespace Org.OpenAPITools.Model
{
return _flagObjectItemsNullable;
}
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -421,6 +428,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -511,6 +519,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}

View File

@ -73,6 +73,12 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("shapeOrNull")]
public ShapeOrNull? ShapeOrNull { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public Dictionary<string, JsonElement> AdditionalProperties { get; } = new Dictionary<string, JsonElement>();
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -86,6 +92,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

View File

@ -137,6 +137,12 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("string_prop")]
public string? StringProp { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public Dictionary<string, JsonElement> AdditionalProperties { get; } = new Dictionary<string, JsonElement>();
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -158,6 +164,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
sb.Append(" StringProp: ").Append(StringProp).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

View File

@ -71,6 +71,12 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("shapeOrNull")]
public ShapeOrNull ShapeOrNull { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public Dictionary<string, JsonElement> AdditionalProperties { get; } = new Dictionary<string, JsonElement>();
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -84,6 +90,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

View File

@ -135,6 +135,12 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("string_prop")]
public string StringProp { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public Dictionary<string, JsonElement> AdditionalProperties { get; } = new Dictionary<string, JsonElement>();
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -156,6 +162,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
sb.Append(" StringProp: ").Append(StringProp).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

View File

@ -71,6 +71,12 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("shapeOrNull")]
public ShapeOrNull ShapeOrNull { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public Dictionary<string, JsonElement> AdditionalProperties { get; } = new Dictionary<string, JsonElement>();
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -84,6 +90,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

View File

@ -135,6 +135,12 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("string_prop")]
public string StringProp { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public Dictionary<string, JsonElement> AdditionalProperties { get; } = new Dictionary<string, JsonElement>();
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -156,6 +162,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
sb.Append(" StringProp: ").Append(StringProp).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

View File

@ -46,6 +46,7 @@ namespace Org.OpenAPITools.Model
this.ShapeOrNull = shapeOrNull;
this.NullableShape = nullableShape;
this.Shapes = shapes;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@ -72,6 +73,12 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "shapes", EmitDefaultValue = false)]
public List<Shape> Shapes { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -85,6 +92,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -143,6 +151,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}

View File

@ -62,6 +62,7 @@ namespace Org.OpenAPITools.Model
this.ObjectNullableProp = objectNullableProp;
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
this.ObjectItemsNullable = objectItemsNullable;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@ -137,6 +138,12 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -158,6 +165,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -248,6 +256,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}

View File

@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model
this.ShapeOrNull = shapeOrNull;
this.NullableShape = nullableShape;
this.Shapes = shapes;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@ -71,6 +72,12 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "shapes", EmitDefaultValue = false)]
public List<Shape> Shapes { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -84,6 +91,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -142,6 +150,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}

View File

@ -61,6 +61,7 @@ namespace Org.OpenAPITools.Model
this.ObjectNullableProp = objectNullableProp;
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
this.ObjectItemsNullable = objectItemsNullable;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@ -136,6 +137,12 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -157,6 +164,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -247,6 +255,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}

View File

@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model
this.ShapeOrNull = shapeOrNull;
this.NullableShape = nullableShape;
this.Shapes = shapes;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@ -71,6 +72,12 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "shapes", EmitDefaultValue = false)]
public List<Shape> Shapes { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -84,6 +91,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -142,6 +150,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}

View File

@ -61,6 +61,7 @@ namespace Org.OpenAPITools.Model
this.ObjectNullableProp = objectNullableProp;
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
this.ObjectItemsNullable = objectItemsNullable;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@ -136,6 +137,12 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -157,6 +164,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -247,6 +255,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}

View File

@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model
this.ShapeOrNull = shapeOrNull;
this.NullableShape = nullableShape;
this.Shapes = shapes;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@ -71,6 +72,12 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "shapes", EmitDefaultValue = false)]
public List<Shape> Shapes { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -84,6 +91,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -142,6 +150,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}

View File

@ -61,6 +61,7 @@ namespace Org.OpenAPITools.Model
this.ObjectNullableProp = objectNullableProp;
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
this.ObjectItemsNullable = objectItemsNullable;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@ -136,6 +137,12 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -157,6 +164,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -247,6 +255,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}

View File

@ -43,6 +43,7 @@ namespace Org.OpenAPITools.Model
this.ShapeOrNull = shapeOrNull;
this.NullableShape = nullableShape;
this.Shapes = shapes;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@ -69,6 +70,12 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "shapes", EmitDefaultValue = false)]
public List<Shape> Shapes { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -82,6 +89,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -137,7 +145,8 @@ namespace Org.OpenAPITools.Model
this.Shapes != null &&
input.Shapes != null &&
this.Shapes.SequenceEqual(input.Shapes)
);
)
&& (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any());
}
/// <summary>
@ -165,6 +174,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}

View File

@ -59,6 +59,7 @@ namespace Org.OpenAPITools.Model
this.ObjectNullableProp = objectNullableProp;
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
this.ObjectItemsNullable = objectItemsNullable;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@ -134,6 +135,12 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -155,6 +162,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -255,7 +263,8 @@ namespace Org.OpenAPITools.Model
this.ObjectItemsNullable != null &&
input.ObjectItemsNullable != null &&
this.ObjectItemsNullable.SequenceEqual(input.ObjectItemsNullable)
);
)
&& (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any());
}
/// <summary>
@ -315,6 +324,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}

View File

@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model
this.ShapeOrNull = shapeOrNull;
this.NullableShape = nullableShape;
this.Shapes = shapes;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@ -71,6 +72,12 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "shapes", EmitDefaultValue = false)]
public List<Shape> Shapes { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -84,6 +91,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -142,6 +150,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}

View File

@ -61,6 +61,7 @@ namespace Org.OpenAPITools.Model
this.ObjectNullableProp = objectNullableProp;
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
this.ObjectItemsNullable = objectItemsNullable;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@ -136,6 +137,12 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -157,6 +164,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -247,6 +255,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}

View File

@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model
this.ShapeOrNull = shapeOrNull;
this.NullableShape = nullableShape;
this.Shapes = shapes;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@ -71,6 +72,12 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "shapes", EmitDefaultValue = false)]
public List<Shape> Shapes { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -84,6 +91,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -142,6 +150,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}

View File

@ -61,6 +61,7 @@ namespace Org.OpenAPITools.Model
this.ObjectNullableProp = objectNullableProp;
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
this.ObjectItemsNullable = objectItemsNullable;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
@ -136,6 +137,12 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -157,6 +164,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@ -247,6 +255,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}

View File

@ -20,8 +20,11 @@ var _ MappedNullable = &AdditionalPropertiesAnyType{}
// AdditionalPropertiesAnyType struct for AdditionalPropertiesAnyType
type AdditionalPropertiesAnyType struct {
Name *string `json:"name,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AdditionalPropertiesAnyType AdditionalPropertiesAnyType
// NewAdditionalPropertiesAnyType instantiates a new AdditionalPropertiesAnyType object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -84,9 +87,31 @@ func (o AdditionalPropertiesAnyType) ToMap() (map[string]interface{}, error) {
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AdditionalPropertiesAnyType) UnmarshalJSON(bytes []byte) (err error) {
varAdditionalPropertiesAnyType := _AdditionalPropertiesAnyType{}
if err = json.Unmarshal(bytes, &varAdditionalPropertiesAnyType); err == nil {
*o = AdditionalPropertiesAnyType(varAdditionalPropertiesAnyType)
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
delete(additionalProperties, "name")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAdditionalPropertiesAnyType struct {
value *AdditionalPropertiesAnyType
isSet bool

View File

@ -20,8 +20,11 @@ var _ MappedNullable = &AdditionalPropertiesArray{}
// AdditionalPropertiesArray struct for AdditionalPropertiesArray
type AdditionalPropertiesArray struct {
Name *string `json:"name,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AdditionalPropertiesArray AdditionalPropertiesArray
// NewAdditionalPropertiesArray instantiates a new AdditionalPropertiesArray object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -84,9 +87,31 @@ func (o AdditionalPropertiesArray) ToMap() (map[string]interface{}, error) {
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AdditionalPropertiesArray) UnmarshalJSON(bytes []byte) (err error) {
varAdditionalPropertiesArray := _AdditionalPropertiesArray{}
if err = json.Unmarshal(bytes, &varAdditionalPropertiesArray); err == nil {
*o = AdditionalPropertiesArray(varAdditionalPropertiesArray)
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
delete(additionalProperties, "name")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAdditionalPropertiesArray struct {
value *AdditionalPropertiesArray
isSet bool

View File

@ -20,8 +20,11 @@ var _ MappedNullable = &AdditionalPropertiesBoolean{}
// AdditionalPropertiesBoolean struct for AdditionalPropertiesBoolean
type AdditionalPropertiesBoolean struct {
Name *string `json:"name,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AdditionalPropertiesBoolean AdditionalPropertiesBoolean
// NewAdditionalPropertiesBoolean instantiates a new AdditionalPropertiesBoolean object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -84,9 +87,31 @@ func (o AdditionalPropertiesBoolean) ToMap() (map[string]interface{}, error) {
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AdditionalPropertiesBoolean) UnmarshalJSON(bytes []byte) (err error) {
varAdditionalPropertiesBoolean := _AdditionalPropertiesBoolean{}
if err = json.Unmarshal(bytes, &varAdditionalPropertiesBoolean); err == nil {
*o = AdditionalPropertiesBoolean(varAdditionalPropertiesBoolean)
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
delete(additionalProperties, "name")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAdditionalPropertiesBoolean struct {
value *AdditionalPropertiesBoolean
isSet bool

View File

@ -20,8 +20,11 @@ var _ MappedNullable = &AdditionalPropertiesInteger{}
// AdditionalPropertiesInteger struct for AdditionalPropertiesInteger
type AdditionalPropertiesInteger struct {
Name *string `json:"name,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AdditionalPropertiesInteger AdditionalPropertiesInteger
// NewAdditionalPropertiesInteger instantiates a new AdditionalPropertiesInteger object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -84,9 +87,31 @@ func (o AdditionalPropertiesInteger) ToMap() (map[string]interface{}, error) {
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AdditionalPropertiesInteger) UnmarshalJSON(bytes []byte) (err error) {
varAdditionalPropertiesInteger := _AdditionalPropertiesInteger{}
if err = json.Unmarshal(bytes, &varAdditionalPropertiesInteger); err == nil {
*o = AdditionalPropertiesInteger(varAdditionalPropertiesInteger)
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
delete(additionalProperties, "name")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAdditionalPropertiesInteger struct {
value *AdditionalPropertiesInteger
isSet bool

View File

@ -20,8 +20,11 @@ var _ MappedNullable = &AdditionalPropertiesNumber{}
// AdditionalPropertiesNumber struct for AdditionalPropertiesNumber
type AdditionalPropertiesNumber struct {
Name *string `json:"name,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AdditionalPropertiesNumber AdditionalPropertiesNumber
// NewAdditionalPropertiesNumber instantiates a new AdditionalPropertiesNumber object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -84,9 +87,31 @@ func (o AdditionalPropertiesNumber) ToMap() (map[string]interface{}, error) {
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AdditionalPropertiesNumber) UnmarshalJSON(bytes []byte) (err error) {
varAdditionalPropertiesNumber := _AdditionalPropertiesNumber{}
if err = json.Unmarshal(bytes, &varAdditionalPropertiesNumber); err == nil {
*o = AdditionalPropertiesNumber(varAdditionalPropertiesNumber)
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
delete(additionalProperties, "name")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAdditionalPropertiesNumber struct {
value *AdditionalPropertiesNumber
isSet bool

View File

@ -20,8 +20,11 @@ var _ MappedNullable = &AdditionalPropertiesObject{}
// AdditionalPropertiesObject struct for AdditionalPropertiesObject
type AdditionalPropertiesObject struct {
Name *string `json:"name,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AdditionalPropertiesObject AdditionalPropertiesObject
// NewAdditionalPropertiesObject instantiates a new AdditionalPropertiesObject object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -84,9 +87,31 @@ func (o AdditionalPropertiesObject) ToMap() (map[string]interface{}, error) {
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AdditionalPropertiesObject) UnmarshalJSON(bytes []byte) (err error) {
varAdditionalPropertiesObject := _AdditionalPropertiesObject{}
if err = json.Unmarshal(bytes, &varAdditionalPropertiesObject); err == nil {
*o = AdditionalPropertiesObject(varAdditionalPropertiesObject)
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
delete(additionalProperties, "name")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAdditionalPropertiesObject struct {
value *AdditionalPropertiesObject
isSet bool

View File

@ -20,8 +20,11 @@ var _ MappedNullable = &AdditionalPropertiesString{}
// AdditionalPropertiesString struct for AdditionalPropertiesString
type AdditionalPropertiesString struct {
Name *string `json:"name,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AdditionalPropertiesString AdditionalPropertiesString
// NewAdditionalPropertiesString instantiates a new AdditionalPropertiesString object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -84,9 +87,31 @@ func (o AdditionalPropertiesString) ToMap() (map[string]interface{}, error) {
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AdditionalPropertiesString) UnmarshalJSON(bytes []byte) (err error) {
varAdditionalPropertiesString := _AdditionalPropertiesString{}
if err = json.Unmarshal(bytes, &varAdditionalPropertiesString); err == nil {
*o = AdditionalPropertiesString(varAdditionalPropertiesString)
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
delete(additionalProperties, "name")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAdditionalPropertiesString struct {
value *AdditionalPropertiesString
isSet bool

View File

@ -79,6 +79,50 @@ public class AdditionalPropertiesAnyType {
this.name = name;
}
/**
* 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.
*
* @param key name of the property
* @param value value of the property
* @return the AdditionalPropertiesAnyType instance itself
*/
public AdditionalPropertiesAnyType 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.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
@ -90,12 +134,13 @@ public class AdditionalPropertiesAnyType {
return false;
}
AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o;
return Objects.equals(this.name, additionalPropertiesAnyType.name);
return Objects.equals(this.name, additionalPropertiesAnyType.name)&&
Objects.equals(this.additionalProperties, additionalPropertiesAnyType.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(name);
return Objects.hash(name, additionalProperties);
}
@Override
@ -103,6 +148,7 @@ public class AdditionalPropertiesAnyType {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesAnyType {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@ -143,14 +189,6 @@ public class AdditionalPropertiesAnyType {
throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesAnyType is not found in the empty JSON string", AdditionalPropertiesAnyType.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AdditionalPropertiesAnyType.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesAnyType` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
@ -172,6 +210,23 @@ public class AdditionalPropertiesAnyType {
@Override
public void write(JsonWriter out, AdditionalPropertiesAnyType value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional 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);
}
@ -179,7 +234,28 @@ public class AdditionalPropertiesAnyType {
public AdditionalPropertiesAnyType read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
AdditionalPropertiesAnyType 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 if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();

View File

@ -80,6 +80,50 @@ public class AdditionalPropertiesArray {
this.name = name;
}
/**
* 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.
*
* @param key name of the property
* @param value value of the property
* @return the AdditionalPropertiesArray instance itself
*/
public AdditionalPropertiesArray 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.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
@ -91,12 +135,13 @@ public class AdditionalPropertiesArray {
return false;
}
AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o;
return Objects.equals(this.name, additionalPropertiesArray.name);
return Objects.equals(this.name, additionalPropertiesArray.name)&&
Objects.equals(this.additionalProperties, additionalPropertiesArray.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(name);
return Objects.hash(name, additionalProperties);
}
@Override
@ -104,6 +149,7 @@ public class AdditionalPropertiesArray {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesArray {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@ -144,14 +190,6 @@ public class AdditionalPropertiesArray {
throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesArray is not found in the empty JSON string", AdditionalPropertiesArray.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AdditionalPropertiesArray.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesArray` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
@ -173,6 +211,23 @@ public class AdditionalPropertiesArray {
@Override
public void write(JsonWriter out, AdditionalPropertiesArray value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional 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);
}
@ -180,7 +235,28 @@ public class AdditionalPropertiesArray {
public AdditionalPropertiesArray read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
AdditionalPropertiesArray 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 if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();

View File

@ -79,6 +79,50 @@ public class AdditionalPropertiesBoolean {
this.name = name;
}
/**
* 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.
*
* @param key name of the property
* @param value value of the property
* @return the AdditionalPropertiesBoolean instance itself
*/
public AdditionalPropertiesBoolean 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.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
@ -90,12 +134,13 @@ public class AdditionalPropertiesBoolean {
return false;
}
AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o;
return Objects.equals(this.name, additionalPropertiesBoolean.name);
return Objects.equals(this.name, additionalPropertiesBoolean.name)&&
Objects.equals(this.additionalProperties, additionalPropertiesBoolean.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(name);
return Objects.hash(name, additionalProperties);
}
@Override
@ -103,6 +148,7 @@ public class AdditionalPropertiesBoolean {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesBoolean {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@ -143,14 +189,6 @@ public class AdditionalPropertiesBoolean {
throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesBoolean is not found in the empty JSON string", AdditionalPropertiesBoolean.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AdditionalPropertiesBoolean.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesBoolean` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
@ -172,6 +210,23 @@ public class AdditionalPropertiesBoolean {
@Override
public void write(JsonWriter out, AdditionalPropertiesBoolean value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional 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);
}
@ -179,7 +234,28 @@ public class AdditionalPropertiesBoolean {
public AdditionalPropertiesBoolean read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
AdditionalPropertiesBoolean 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 if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();

View File

@ -79,6 +79,50 @@ public class AdditionalPropertiesInteger {
this.name = name;
}
/**
* 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.
*
* @param key name of the property
* @param value value of the property
* @return the AdditionalPropertiesInteger instance itself
*/
public AdditionalPropertiesInteger 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.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
@ -90,12 +134,13 @@ public class AdditionalPropertiesInteger {
return false;
}
AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o;
return Objects.equals(this.name, additionalPropertiesInteger.name);
return Objects.equals(this.name, additionalPropertiesInteger.name)&&
Objects.equals(this.additionalProperties, additionalPropertiesInteger.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(name);
return Objects.hash(name, additionalProperties);
}
@Override
@ -103,6 +148,7 @@ public class AdditionalPropertiesInteger {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesInteger {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@ -143,14 +189,6 @@ public class AdditionalPropertiesInteger {
throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesInteger is not found in the empty JSON string", AdditionalPropertiesInteger.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AdditionalPropertiesInteger.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesInteger` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
@ -172,6 +210,23 @@ public class AdditionalPropertiesInteger {
@Override
public void write(JsonWriter out, AdditionalPropertiesInteger value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional 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);
}
@ -179,7 +234,28 @@ public class AdditionalPropertiesInteger {
public AdditionalPropertiesInteger read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
AdditionalPropertiesInteger 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 if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();

View File

@ -80,6 +80,50 @@ public class AdditionalPropertiesNumber {
this.name = name;
}
/**
* 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.
*
* @param key name of the property
* @param value value of the property
* @return the AdditionalPropertiesNumber instance itself
*/
public AdditionalPropertiesNumber 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.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
@ -91,12 +135,13 @@ public class AdditionalPropertiesNumber {
return false;
}
AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o;
return Objects.equals(this.name, additionalPropertiesNumber.name);
return Objects.equals(this.name, additionalPropertiesNumber.name)&&
Objects.equals(this.additionalProperties, additionalPropertiesNumber.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(name);
return Objects.hash(name, additionalProperties);
}
@Override
@ -104,6 +149,7 @@ public class AdditionalPropertiesNumber {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesNumber {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@ -144,14 +190,6 @@ public class AdditionalPropertiesNumber {
throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesNumber is not found in the empty JSON string", AdditionalPropertiesNumber.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AdditionalPropertiesNumber.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesNumber` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
@ -173,6 +211,23 @@ public class AdditionalPropertiesNumber {
@Override
public void write(JsonWriter out, AdditionalPropertiesNumber value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional 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);
}
@ -180,7 +235,28 @@ public class AdditionalPropertiesNumber {
public AdditionalPropertiesNumber read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
AdditionalPropertiesNumber 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 if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();

View File

@ -80,6 +80,50 @@ public class AdditionalPropertiesObject {
this.name = name;
}
/**
* 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.
*
* @param key name of the property
* @param value value of the property
* @return the AdditionalPropertiesObject instance itself
*/
public AdditionalPropertiesObject 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.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
@ -91,12 +135,13 @@ public class AdditionalPropertiesObject {
return false;
}
AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o;
return Objects.equals(this.name, additionalPropertiesObject.name);
return Objects.equals(this.name, additionalPropertiesObject.name)&&
Objects.equals(this.additionalProperties, additionalPropertiesObject.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(name);
return Objects.hash(name, additionalProperties);
}
@Override
@ -104,6 +149,7 @@ public class AdditionalPropertiesObject {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesObject {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@ -144,14 +190,6 @@ public class AdditionalPropertiesObject {
throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesObject is not found in the empty JSON string", AdditionalPropertiesObject.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AdditionalPropertiesObject.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesObject` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
@ -173,6 +211,23 @@ public class AdditionalPropertiesObject {
@Override
public void write(JsonWriter out, AdditionalPropertiesObject value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional 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);
}
@ -180,7 +235,28 @@ public class AdditionalPropertiesObject {
public AdditionalPropertiesObject read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
AdditionalPropertiesObject 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 if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();

View File

@ -79,6 +79,50 @@ public class AdditionalPropertiesString {
this.name = name;
}
/**
* 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.
*
* @param key name of the property
* @param value value of the property
* @return the AdditionalPropertiesString instance itself
*/
public AdditionalPropertiesString 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.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
@ -90,12 +134,13 @@ public class AdditionalPropertiesString {
return false;
}
AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o;
return Objects.equals(this.name, additionalPropertiesString.name);
return Objects.equals(this.name, additionalPropertiesString.name)&&
Objects.equals(this.additionalProperties, additionalPropertiesString.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(name);
return Objects.hash(name, additionalProperties);
}
@Override
@ -103,6 +148,7 @@ public class AdditionalPropertiesString {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesString {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@ -143,14 +189,6 @@ public class AdditionalPropertiesString {
throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesString is not found in the empty JSON string", AdditionalPropertiesString.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AdditionalPropertiesString.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesString` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
@ -172,6 +210,23 @@ public class AdditionalPropertiesString {
@Override
public void write(JsonWriter out, AdditionalPropertiesString value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional 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);
}
@ -179,7 +234,28 @@ public class AdditionalPropertiesString {
public AdditionalPropertiesString read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
AdditionalPropertiesString 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 if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();

View File

@ -81,6 +81,50 @@ public class AdditionalPropertiesAnyType implements Parcelable {
this.name = name;
}
/**
* 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.
*
* @param key name of the property
* @param value value of the property
* @return the AdditionalPropertiesAnyType instance itself
*/
public AdditionalPropertiesAnyType 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.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
@ -92,12 +136,13 @@ public class AdditionalPropertiesAnyType implements Parcelable {
return false;
}
AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o;
return Objects.equals(this.name, additionalPropertiesAnyType.name);
return Objects.equals(this.name, additionalPropertiesAnyType.name)&&
Objects.equals(this.additionalProperties, additionalPropertiesAnyType.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(name);
return Objects.hash(name, additionalProperties);
}
@Override
@ -105,6 +150,7 @@ public class AdditionalPropertiesAnyType implements Parcelable {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesAnyType {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@ -166,14 +212,6 @@ public class AdditionalPropertiesAnyType implements Parcelable {
throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesAnyType is not found in the empty JSON string", AdditionalPropertiesAnyType.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AdditionalPropertiesAnyType.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesAnyType` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
@ -195,6 +233,23 @@ public class AdditionalPropertiesAnyType implements Parcelable {
@Override
public void write(JsonWriter out, AdditionalPropertiesAnyType value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional 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);
}
@ -202,7 +257,28 @@ public class AdditionalPropertiesAnyType implements Parcelable {
public AdditionalPropertiesAnyType read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
AdditionalPropertiesAnyType 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 if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();

View File

@ -82,6 +82,50 @@ public class AdditionalPropertiesArray implements Parcelable {
this.name = name;
}
/**
* 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.
*
* @param key name of the property
* @param value value of the property
* @return the AdditionalPropertiesArray instance itself
*/
public AdditionalPropertiesArray 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.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
@ -93,12 +137,13 @@ public class AdditionalPropertiesArray implements Parcelable {
return false;
}
AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o;
return Objects.equals(this.name, additionalPropertiesArray.name);
return Objects.equals(this.name, additionalPropertiesArray.name)&&
Objects.equals(this.additionalProperties, additionalPropertiesArray.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(name);
return Objects.hash(name, additionalProperties);
}
@Override
@ -106,6 +151,7 @@ public class AdditionalPropertiesArray implements Parcelable {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesArray {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@ -167,14 +213,6 @@ public class AdditionalPropertiesArray implements Parcelable {
throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesArray is not found in the empty JSON string", AdditionalPropertiesArray.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AdditionalPropertiesArray.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesArray` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
@ -196,6 +234,23 @@ public class AdditionalPropertiesArray implements Parcelable {
@Override
public void write(JsonWriter out, AdditionalPropertiesArray value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional 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);
}
@ -203,7 +258,28 @@ public class AdditionalPropertiesArray implements Parcelable {
public AdditionalPropertiesArray read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
AdditionalPropertiesArray 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 if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();

View File

@ -81,6 +81,50 @@ public class AdditionalPropertiesBoolean implements Parcelable {
this.name = name;
}
/**
* 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.
*
* @param key name of the property
* @param value value of the property
* @return the AdditionalPropertiesBoolean instance itself
*/
public AdditionalPropertiesBoolean 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.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
@ -92,12 +136,13 @@ public class AdditionalPropertiesBoolean implements Parcelable {
return false;
}
AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o;
return Objects.equals(this.name, additionalPropertiesBoolean.name);
return Objects.equals(this.name, additionalPropertiesBoolean.name)&&
Objects.equals(this.additionalProperties, additionalPropertiesBoolean.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(name);
return Objects.hash(name, additionalProperties);
}
@Override
@ -105,6 +150,7 @@ public class AdditionalPropertiesBoolean implements Parcelable {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesBoolean {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@ -166,14 +212,6 @@ public class AdditionalPropertiesBoolean implements Parcelable {
throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesBoolean is not found in the empty JSON string", AdditionalPropertiesBoolean.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AdditionalPropertiesBoolean.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesBoolean` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
@ -195,6 +233,23 @@ public class AdditionalPropertiesBoolean implements Parcelable {
@Override
public void write(JsonWriter out, AdditionalPropertiesBoolean value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional 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);
}
@ -202,7 +257,28 @@ public class AdditionalPropertiesBoolean implements Parcelable {
public AdditionalPropertiesBoolean read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
AdditionalPropertiesBoolean 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 if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();

View File

@ -81,6 +81,50 @@ public class AdditionalPropertiesInteger implements Parcelable {
this.name = name;
}
/**
* 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.
*
* @param key name of the property
* @param value value of the property
* @return the AdditionalPropertiesInteger instance itself
*/
public AdditionalPropertiesInteger 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.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
@ -92,12 +136,13 @@ public class AdditionalPropertiesInteger implements Parcelable {
return false;
}
AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o;
return Objects.equals(this.name, additionalPropertiesInteger.name);
return Objects.equals(this.name, additionalPropertiesInteger.name)&&
Objects.equals(this.additionalProperties, additionalPropertiesInteger.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(name);
return Objects.hash(name, additionalProperties);
}
@Override
@ -105,6 +150,7 @@ public class AdditionalPropertiesInteger implements Parcelable {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesInteger {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@ -166,14 +212,6 @@ public class AdditionalPropertiesInteger implements Parcelable {
throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesInteger is not found in the empty JSON string", AdditionalPropertiesInteger.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AdditionalPropertiesInteger.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesInteger` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
@ -195,6 +233,23 @@ public class AdditionalPropertiesInteger implements Parcelable {
@Override
public void write(JsonWriter out, AdditionalPropertiesInteger value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional 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);
}
@ -202,7 +257,28 @@ public class AdditionalPropertiesInteger implements Parcelable {
public AdditionalPropertiesInteger read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
AdditionalPropertiesInteger 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 if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();

View File

@ -82,6 +82,50 @@ public class AdditionalPropertiesNumber implements Parcelable {
this.name = name;
}
/**
* 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.
*
* @param key name of the property
* @param value value of the property
* @return the AdditionalPropertiesNumber instance itself
*/
public AdditionalPropertiesNumber 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.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
@ -93,12 +137,13 @@ public class AdditionalPropertiesNumber implements Parcelable {
return false;
}
AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o;
return Objects.equals(this.name, additionalPropertiesNumber.name);
return Objects.equals(this.name, additionalPropertiesNumber.name)&&
Objects.equals(this.additionalProperties, additionalPropertiesNumber.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(name);
return Objects.hash(name, additionalProperties);
}
@Override
@ -106,6 +151,7 @@ public class AdditionalPropertiesNumber implements Parcelable {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesNumber {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@ -167,14 +213,6 @@ public class AdditionalPropertiesNumber implements Parcelable {
throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesNumber is not found in the empty JSON string", AdditionalPropertiesNumber.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AdditionalPropertiesNumber.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesNumber` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
@ -196,6 +234,23 @@ public class AdditionalPropertiesNumber implements Parcelable {
@Override
public void write(JsonWriter out, AdditionalPropertiesNumber value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional 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);
}
@ -203,7 +258,28 @@ public class AdditionalPropertiesNumber implements Parcelable {
public AdditionalPropertiesNumber read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
AdditionalPropertiesNumber 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 if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();

View File

@ -82,6 +82,50 @@ public class AdditionalPropertiesObject implements Parcelable {
this.name = name;
}
/**
* 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.
*
* @param key name of the property
* @param value value of the property
* @return the AdditionalPropertiesObject instance itself
*/
public AdditionalPropertiesObject 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.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
@ -93,12 +137,13 @@ public class AdditionalPropertiesObject implements Parcelable {
return false;
}
AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o;
return Objects.equals(this.name, additionalPropertiesObject.name);
return Objects.equals(this.name, additionalPropertiesObject.name)&&
Objects.equals(this.additionalProperties, additionalPropertiesObject.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(name);
return Objects.hash(name, additionalProperties);
}
@Override
@ -106,6 +151,7 @@ public class AdditionalPropertiesObject implements Parcelable {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesObject {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@ -167,14 +213,6 @@ public class AdditionalPropertiesObject implements Parcelable {
throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesObject is not found in the empty JSON string", AdditionalPropertiesObject.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AdditionalPropertiesObject.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesObject` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
@ -196,6 +234,23 @@ public class AdditionalPropertiesObject implements Parcelable {
@Override
public void write(JsonWriter out, AdditionalPropertiesObject value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional 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);
}
@ -203,7 +258,28 @@ public class AdditionalPropertiesObject implements Parcelable {
public AdditionalPropertiesObject read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
AdditionalPropertiesObject 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 if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();

View File

@ -81,6 +81,50 @@ public class AdditionalPropertiesString implements Parcelable {
this.name = name;
}
/**
* 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.
*
* @param key name of the property
* @param value value of the property
* @return the AdditionalPropertiesString instance itself
*/
public AdditionalPropertiesString 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.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
@ -92,12 +136,13 @@ public class AdditionalPropertiesString implements Parcelable {
return false;
}
AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o;
return Objects.equals(this.name, additionalPropertiesString.name);
return Objects.equals(this.name, additionalPropertiesString.name)&&
Objects.equals(this.additionalProperties, additionalPropertiesString.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(name);
return Objects.hash(name, additionalProperties);
}
@Override
@ -105,6 +150,7 @@ public class AdditionalPropertiesString implements Parcelable {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesString {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@ -166,14 +212,6 @@ public class AdditionalPropertiesString implements Parcelable {
throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesString is not found in the empty JSON string", AdditionalPropertiesString.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!AdditionalPropertiesString.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesString` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
@ -195,6 +233,23 @@ public class AdditionalPropertiesString implements Parcelable {
@Override
public void write(JsonWriter out, AdditionalPropertiesString value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional 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);
}
@ -202,7 +257,28 @@ public class AdditionalPropertiesString implements Parcelable {
public AdditionalPropertiesString read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
AdditionalPropertiesString 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 if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();

View File

@ -169,6 +169,50 @@ public class Drawing {
this.shapes = shapes;
}
/**
* 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.
*
* @param key name of the property
* @param value value of the property
* @return the Drawing instance itself
*/
public Drawing 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.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
@ -183,7 +227,8 @@ public class Drawing {
return Objects.equals(this.mainShape, drawing.mainShape) &&
Objects.equals(this.shapeOrNull, drawing.shapeOrNull) &&
Objects.equals(this.nullableShape, drawing.nullableShape) &&
Objects.equals(this.shapes, drawing.shapes);
Objects.equals(this.shapes, drawing.shapes)&&
Objects.equals(this.additionalProperties, drawing.additionalProperties);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
@ -192,7 +237,7 @@ public class Drawing {
@Override
public int hashCode() {
return Objects.hash(mainShape, shapeOrNull, nullableShape, shapes);
return Objects.hash(mainShape, shapeOrNull, nullableShape, shapes, additionalProperties);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
@ -210,6 +255,7 @@ public class Drawing {
sb.append(" shapeOrNull: ").append(toIndentedString(shapeOrNull)).append("\n");
sb.append(" nullableShape: ").append(toIndentedString(nullableShape)).append("\n");
sb.append(" shapes: ").append(toIndentedString(shapes)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@ -253,14 +299,6 @@ public class Drawing {
throw new IllegalArgumentException(String.format("The required field(s) %s in Drawing is not found in the empty JSON string", Drawing.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!Drawing.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Drawing` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
// validate the optional field `mainShape`
if (jsonObj.get("mainShape") != null && !jsonObj.get("mainShape").isJsonNull()) {
@ -305,6 +343,23 @@ public class Drawing {
@Override
public void write(JsonWriter out, Drawing value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional 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);
}
@ -312,7 +367,28 @@ public class Drawing {
public Drawing read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
Drawing 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 if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();

View File

@ -410,6 +410,50 @@ public class NullableClass {
this.objectItemsNullable = objectItemsNullable;
}
/**
* 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.
*
* @param key name of the property
* @param value value of the property
* @return the NullableClass instance itself
*/
public NullableClass 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.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}
@Override
@ -432,7 +476,8 @@ public class NullableClass {
Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) &&
Objects.equals(this.objectNullableProp, nullableClass.objectNullableProp) &&
Objects.equals(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) &&
Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable);
Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable)&&
Objects.equals(this.additionalProperties, nullableClass.additionalProperties);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
@ -441,7 +486,7 @@ public class NullableClass {
@Override
public int hashCode() {
return Objects.hash(integerProp, numberProp, booleanProp, stringProp, dateProp, datetimeProp, arrayNullableProp, arrayAndItemsNullableProp, arrayItemsNullable, objectNullableProp, objectAndItemsNullableProp, objectItemsNullable);
return Objects.hash(integerProp, numberProp, booleanProp, stringProp, dateProp, datetimeProp, arrayNullableProp, arrayAndItemsNullableProp, arrayItemsNullable, objectNullableProp, objectAndItemsNullableProp, objectItemsNullable, additionalProperties);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
@ -467,6 +512,7 @@ public class NullableClass {
sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n");
sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n");
sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}
@ -518,14 +564,6 @@ public class NullableClass {
throw new IllegalArgumentException(String.format("The required field(s) %s in NullableClass is not found in the empty JSON string", NullableClass.openapiRequiredFields.toString()));
}
}
Set<Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Entry<String, JsonElement> entry : entries) {
if (!NullableClass.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NullableClass` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("string_prop") != null && !jsonObj.get("string_prop").isJsonNull()) && !jsonObj.get("string_prop").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `string_prop` to be a primitive type in the JSON string but got `%s`", jsonObj.get("string_prop").toString()));
@ -559,6 +597,23 @@ public class NullableClass {
@Override
public void write(JsonWriter out, NullableClass value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additional 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);
}
@ -566,7 +621,28 @@ public class NullableClass {
public NullableClass read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
JsonObject jsonObj = jsonElement.getAsJsonObject();
// store additional fields in the deserialized instance
NullableClass 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 if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();

View File

@ -89,12 +89,14 @@ function ConvertFrom-PSJsonToDrawing {
$PSBoundParameters | Out-DebugParameter | Write-Debug
$JsonParameters = ConvertFrom-Json -InputObject $Json
$PSDrawingAdditionalProperties = @{}
# check if Json contains properties not defined in PSDrawing
$AllProperties = ("mainShape", "shapeOrNull", "nullableShape", "shapes")
foreach ($name in $JsonParameters.PsObject.Properties.Name) {
# store undefined properties in additionalProperties
if (!($AllProperties.Contains($name))) {
throw "Error! JSON key '$name' not found in the properties: $($AllProperties)"
$PSDrawingAdditionalProperties[$name] = $JsonParameters.PSobject.Properties[$name].value
}
}
@ -127,6 +129,7 @@ function ConvertFrom-PSJsonToDrawing {
"shapeOrNull" = ${ShapeOrNull}
"nullableShape" = ${NullableShape}
"shapes" = ${Shapes}
"AdditionalProperties" = $PSDrawingAdditionalProperties
}
return $PSO

View File

@ -137,12 +137,14 @@ function ConvertFrom-PSJsonToNullableClass {
$PSBoundParameters | Out-DebugParameter | Write-Debug
$JsonParameters = ConvertFrom-Json -InputObject $Json
$PSNullableClassAdditionalProperties = @{}
# check if Json contains properties not defined in PSNullableClass
$AllProperties = ("integer_prop", "number_prop", "boolean_prop", "string_prop", "date_prop", "datetime_prop", "array_nullable_prop", "array_and_items_nullable_prop", "array_items_nullable", "object_nullable_prop", "object_and_items_nullable_prop", "object_items_nullable")
foreach ($name in $JsonParameters.PsObject.Properties.Name) {
# store undefined properties in additionalProperties
if (!($AllProperties.Contains($name))) {
throw "Error! JSON key '$name' not found in the properties: $($AllProperties)"
$PSNullableClassAdditionalProperties[$name] = $JsonParameters.PSobject.Properties[$name].value
}
}
@ -231,6 +233,7 @@ function ConvertFrom-PSJsonToNullableClass {
"object_nullable_prop" = ${ObjectNullableProp}
"object_and_items_nullable_prop" = ${ObjectAndItemsNullableProp}
"object_items_nullable" = ${ObjectItemsNullable}
"AdditionalProperties" = $PSNullableClassAdditionalProperties
}
return $PSO

View File

@ -447,7 +447,7 @@ export interface Dog extends Animal {
* @interface Drawing
*/
export interface Drawing {
[key: string]: Fruit | any;
[key: string]: Fruit;
/**
*
@ -1043,7 +1043,7 @@ export interface Name {
* @interface NullableClass
*/
export interface NullableClass {
[key: string]: object | any;
[key: string]: object;
/**
*

View File

@ -811,7 +811,7 @@ export interface Name {
* @interface NullableClass
*/
export interface NullableClass {
[key: string]: object | any;
[key: string]: object;
/**
*

View File

@ -32,8 +32,11 @@ type NullableClass struct {
ObjectNullableProp map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"`
ObjectAndItemsNullableProp map[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"`
ObjectItemsNullable map[string]map[string]interface{} `json:"object_items_nullable,omitempty"`
AdditionalProperties map[string]interface{}
}
type _NullableClass NullableClass
// NewNullableClass instantiates a new NullableClass object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -549,9 +552,42 @@ func (o NullableClass) ToMap() (map[string]interface{}, error) {
if !IsNil(o.ObjectItemsNullable) {
toSerialize["object_items_nullable"] = o.ObjectItemsNullable
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *NullableClass) UnmarshalJSON(bytes []byte) (err error) {
varNullableClass := _NullableClass{}
if err = json.Unmarshal(bytes, &varNullableClass); err == nil {
*o = NullableClass(varNullableClass)
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
delete(additionalProperties, "integer_prop")
delete(additionalProperties, "number_prop")
delete(additionalProperties, "boolean_prop")
delete(additionalProperties, "string_prop")
delete(additionalProperties, "date_prop")
delete(additionalProperties, "datetime_prop")
delete(additionalProperties, "array_nullable_prop")
delete(additionalProperties, "array_and_items_nullable_prop")
delete(additionalProperties, "array_items_nullable")
delete(additionalProperties, "object_nullable_prop")
delete(additionalProperties, "object_and_items_nullable_prop")
delete(additionalProperties, "object_items_nullable")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableNullableClass struct {
value *NullableClass
isSet bool

View File

@ -3,7 +3,10 @@
.gitlab-ci.yml
.travis.yml
README.md
docs/AdditionalPropertiesAnyType.md
docs/AdditionalPropertiesClass.md
docs/AdditionalPropertiesObject.md
docs/AdditionalPropertiesWithDescriptionOnly.md
docs/AllOfWithSingleRef.md
docs/Animal.md
docs/AnotherFakeApi.md
@ -100,7 +103,10 @@ petstore_api/api_response.py
petstore_api/configuration.py
petstore_api/exceptions.py
petstore_api/models/__init__.py
petstore_api/models/additional_properties_any_type.py
petstore_api/models/additional_properties_class.py
petstore_api/models/additional_properties_object.py
petstore_api/models/additional_properties_with_description_only.py
petstore_api/models/all_of_with_single_ref.py
petstore_api/models/animal.py
petstore_api/models/any_of_color.py

View File

@ -132,7 +132,10 @@ Class | Method | HTTP request | Description
## Documentation For Models
- [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md)
- [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
- [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md)
- [AdditionalPropertiesWithDescriptionOnly](docs/AdditionalPropertiesWithDescriptionOnly.md)
- [AllOfWithSingleRef](docs/AllOfWithSingleRef.md)
- [Animal](docs/Animal.md)
- [AnyOfColor](docs/AnyOfColor.md)

View File

@ -0,0 +1,28 @@
# AdditionalPropertiesAnyType
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
## Example
```python
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
# TODO update the JSON string below
json = "{}"
# create an instance of AdditionalPropertiesAnyType from a JSON string
additional_properties_any_type_instance = AdditionalPropertiesAnyType.from_json(json)
# print the JSON string representation of the object
print AdditionalPropertiesAnyType.to_json()
# convert the object into a dict
additional_properties_any_type_dict = additional_properties_any_type_instance.to_dict()
# create an instance of AdditionalPropertiesAnyType from a dict
additional_properties_any_type_form_dict = additional_properties_any_type.from_dict(additional_properties_any_type_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,28 @@
# AdditionalPropertiesObject
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
## Example
```python
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
# TODO update the JSON string below
json = "{}"
# create an instance of AdditionalPropertiesObject from a JSON string
additional_properties_object_instance = AdditionalPropertiesObject.from_json(json)
# print the JSON string representation of the object
print AdditionalPropertiesObject.to_json()
# convert the object into a dict
additional_properties_object_dict = additional_properties_object_instance.to_dict()
# create an instance of AdditionalPropertiesObject from a dict
additional_properties_object_form_dict = additional_properties_object.from_dict(additional_properties_object_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,28 @@
# AdditionalPropertiesWithDescriptionOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
## Example
```python
from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly
# TODO update the JSON string below
json = "{}"
# create an instance of AdditionalPropertiesWithDescriptionOnly from a JSON string
additional_properties_with_description_only_instance = AdditionalPropertiesWithDescriptionOnly.from_json(json)
# print the JSON string representation of the object
print AdditionalPropertiesWithDescriptionOnly.to_json()
# convert the object into a dict
additional_properties_with_description_only_dict = additional_properties_with_description_only_instance.to_dict()
# create an instance of AdditionalPropertiesWithDescriptionOnly from a dict
additional_properties_with_description_only_form_dict = additional_properties_with_description_only.from_dict(additional_properties_with_description_only_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -38,7 +38,10 @@ from petstore_api.exceptions import ApiException
from petstore_api.signing import HttpSigningConfiguration
# import models into sdk package
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly
from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef
from petstore_api.models.animal import Animal
from petstore_api.models.any_of_color import AnyOfColor

View File

@ -14,7 +14,10 @@
# import models into model package
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly
from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef
from petstore_api.models.animal import Animal
from petstore_api.models.any_of_color import AnyOfColor

View File

@ -0,0 +1,83 @@
# coding: utf-8
"""
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: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import BaseModel, StrictStr
class AdditionalPropertiesAnyType(BaseModel):
"""
AdditionalPropertiesAnyType
"""
name: Optional[StrictStr] = None
additional_properties: Dict[str, Any] = {}
__properties = ["name"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.dict(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> AdditionalPropertiesAnyType:
"""Create an instance of AdditionalPropertiesAnyType from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self):
"""Returns the dictionary representation of the model using alias"""
_dict = self.dict(by_alias=True,
exclude={
"additional_properties"
},
exclude_none=True)
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
_dict[_key] = _value
return _dict
@classmethod
def from_dict(cls, obj: dict) -> AdditionalPropertiesAnyType:
"""Create an instance of AdditionalPropertiesAnyType from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return AdditionalPropertiesAnyType.parse_obj(obj)
_obj = AdditionalPropertiesAnyType.parse_obj({
"name": obj.get("name")
})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj

View File

@ -0,0 +1,83 @@
# coding: utf-8
"""
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: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import BaseModel, StrictStr
class AdditionalPropertiesObject(BaseModel):
"""
AdditionalPropertiesObject
"""
name: Optional[StrictStr] = None
additional_properties: Dict[str, Any] = {}
__properties = ["name"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.dict(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> AdditionalPropertiesObject:
"""Create an instance of AdditionalPropertiesObject from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self):
"""Returns the dictionary representation of the model using alias"""
_dict = self.dict(by_alias=True,
exclude={
"additional_properties"
},
exclude_none=True)
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
_dict[_key] = _value
return _dict
@classmethod
def from_dict(cls, obj: dict) -> AdditionalPropertiesObject:
"""Create an instance of AdditionalPropertiesObject from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return AdditionalPropertiesObject.parse_obj(obj)
_obj = AdditionalPropertiesObject.parse_obj({
"name": obj.get("name")
})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj

View File

@ -0,0 +1,83 @@
# coding: utf-8
"""
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: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from typing import Optional
from pydantic import BaseModel, StrictStr
class AdditionalPropertiesWithDescriptionOnly(BaseModel):
"""
AdditionalPropertiesWithDescriptionOnly
"""
name: Optional[StrictStr] = None
additional_properties: Dict[str, Any] = {}
__properties = ["name"]
class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.dict(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> AdditionalPropertiesWithDescriptionOnly:
"""Create an instance of AdditionalPropertiesWithDescriptionOnly from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self):
"""Returns the dictionary representation of the model using alias"""
_dict = self.dict(by_alias=True,
exclude={
"additional_properties"
},
exclude_none=True)
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
_dict[_key] = _value
return _dict
@classmethod
def from_dict(cls, obj: dict) -> AdditionalPropertiesWithDescriptionOnly:
"""Create an instance of AdditionalPropertiesWithDescriptionOnly from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return AdditionalPropertiesWithDescriptionOnly.parse_obj(obj)
_obj = AdditionalPropertiesWithDescriptionOnly.parse_obj({
"name": obj.get("name")
})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj

View File

@ -38,6 +38,7 @@ class NullableClass(BaseModel):
object_nullable_prop: Optional[Dict[str, Dict[str, Any]]] = None
object_and_items_nullable_prop: Optional[Dict[str, Dict[str, Any]]] = None
object_items_nullable: Optional[Dict[str, Dict[str, Any]]] = None
additional_properties: Dict[str, Any] = {}
__properties = ["required_integer_prop", "integer_prop", "number_prop", "boolean_prop", "string_prop", "date_prop", "datetime_prop", "array_nullable_prop", "array_and_items_nullable_prop", "array_items_nullable", "object_nullable_prop", "object_and_items_nullable_prop", "object_items_nullable"]
class Config:
@ -62,8 +63,14 @@ class NullableClass(BaseModel):
"""Returns the dictionary representation of the model using alias"""
_dict = self.dict(by_alias=True,
exclude={
"additional_properties"
},
exclude_none=True)
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
_dict[_key] = _value
# set to None if required_integer_prop (nullable) is None
# and __fields_set__ contains the field
if self.required_integer_prop is None and "required_integer_prop" in self.__fields_set__:
@ -145,6 +152,11 @@ class NullableClass(BaseModel):
"object_and_items_nullable_prop": obj.get("object_and_items_nullable_prop"),
"object_items_nullable": obj.get("object_items_nullable")
})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)
return _obj

View File

@ -0,0 +1,54 @@
# coding: utf-8
"""
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: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType # noqa: E501
from petstore_api.rest import ApiException
class TestAdditionalPropertiesAnyType(unittest.TestCase):
"""AdditionalPropertiesAnyType unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def make_instance(self, include_optional):
"""Test AdditionalPropertiesAnyType
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `AdditionalPropertiesAnyType`
"""
model = petstore_api.models.additional_properties_any_type.AdditionalPropertiesAnyType() # noqa: E501
if include_optional :
return AdditionalPropertiesAnyType(
name = ''
)
else :
return AdditionalPropertiesAnyType(
)
"""
def testAdditionalPropertiesAnyType(self):
"""Test AdditionalPropertiesAnyType"""
# inst_req_only = self.make_instance(include_optional=False)
# inst_req_and_optional = self.make_instance(include_optional=True)
if __name__ == '__main__':
unittest.main()

View File

@ -6,12 +6,12 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
from __future__ import absolute_import
import unittest
import datetime
@ -33,7 +33,9 @@ class TestAdditionalPropertiesClass(unittest.TestCase):
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501
# uncomment below to create an instance of `AdditionalPropertiesClass`
"""
model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501
if include_optional :
return AdditionalPropertiesClass(
map_property = {
@ -48,6 +50,7 @@ class TestAdditionalPropertiesClass(unittest.TestCase):
else :
return AdditionalPropertiesClass(
)
"""
def testAdditionalPropertiesClass(self):
"""Test AdditionalPropertiesClass"""

View File

@ -0,0 +1,54 @@
# coding: utf-8
"""
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: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject # noqa: E501
from petstore_api.rest import ApiException
class TestAdditionalPropertiesObject(unittest.TestCase):
"""AdditionalPropertiesObject unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def make_instance(self, include_optional):
"""Test AdditionalPropertiesObject
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `AdditionalPropertiesObject`
"""
model = petstore_api.models.additional_properties_object.AdditionalPropertiesObject() # noqa: E501
if include_optional :
return AdditionalPropertiesObject(
name = ''
)
else :
return AdditionalPropertiesObject(
)
"""
def testAdditionalPropertiesObject(self):
"""Test AdditionalPropertiesObject"""
# inst_req_only = self.make_instance(include_optional=False)
# inst_req_and_optional = self.make_instance(include_optional=True)
if __name__ == '__main__':
unittest.main()

View File

@ -0,0 +1,54 @@
# coding: utf-8
"""
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: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import unittest
import datetime
import petstore_api
from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly # noqa: E501
from petstore_api.rest import ApiException
class TestAdditionalPropertiesWithDescriptionOnly(unittest.TestCase):
"""AdditionalPropertiesWithDescriptionOnly unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def make_instance(self, include_optional):
"""Test AdditionalPropertiesWithDescriptionOnly
include_option is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `AdditionalPropertiesWithDescriptionOnly`
"""
model = petstore_api.models.additional_properties_with_description_only.AdditionalPropertiesWithDescriptionOnly() # noqa: E501
if include_optional :
return AdditionalPropertiesWithDescriptionOnly(
name = ''
)
else :
return AdditionalPropertiesWithDescriptionOnly(
)
"""
def testAdditionalPropertiesWithDescriptionOnly(self):
"""Test AdditionalPropertiesWithDescriptionOnly"""
# inst_req_only = self.make_instance(include_optional=False)
# inst_req_and_optional = self.make_instance(include_optional=True)
if __name__ == '__main__':
unittest.main()

View File

@ -3,7 +3,10 @@
.gitlab-ci.yml
.travis.yml
README.md
docs/AdditionalPropertiesAnyType.md
docs/AdditionalPropertiesClass.md
docs/AdditionalPropertiesObject.md
docs/AdditionalPropertiesWithDescriptionOnly.md
docs/AllOfWithSingleRef.md
docs/Animal.md
docs/AnotherFakeApi.md
@ -100,7 +103,10 @@ petstore_api/api_response.py
petstore_api/configuration.py
petstore_api/exceptions.py
petstore_api/models/__init__.py
petstore_api/models/additional_properties_any_type.py
petstore_api/models/additional_properties_class.py
petstore_api/models/additional_properties_object.py
petstore_api/models/additional_properties_with_description_only.py
petstore_api/models/all_of_with_single_ref.py
petstore_api/models/animal.py
petstore_api/models/any_of_color.py

View File

@ -132,7 +132,10 @@ Class | Method | HTTP request | Description
## Documentation For Models
- [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md)
- [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
- [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md)
- [AdditionalPropertiesWithDescriptionOnly](docs/AdditionalPropertiesWithDescriptionOnly.md)
- [AllOfWithSingleRef](docs/AllOfWithSingleRef.md)
- [Animal](docs/Animal.md)
- [AnyOfColor](docs/AnyOfColor.md)

View File

@ -0,0 +1,28 @@
# AdditionalPropertiesAnyType
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
## Example
```python
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
# TODO update the JSON string below
json = "{}"
# create an instance of AdditionalPropertiesAnyType from a JSON string
additional_properties_any_type_instance = AdditionalPropertiesAnyType.from_json(json)
# print the JSON string representation of the object
print AdditionalPropertiesAnyType.to_json()
# convert the object into a dict
additional_properties_any_type_dict = additional_properties_any_type_instance.to_dict()
# create an instance of AdditionalPropertiesAnyType from a dict
additional_properties_any_type_form_dict = additional_properties_any_type.from_dict(additional_properties_any_type_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,28 @@
# AdditionalPropertiesObject
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
## Example
```python
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
# TODO update the JSON string below
json = "{}"
# create an instance of AdditionalPropertiesObject from a JSON string
additional_properties_object_instance = AdditionalPropertiesObject.from_json(json)
# print the JSON string representation of the object
print AdditionalPropertiesObject.to_json()
# convert the object into a dict
additional_properties_object_dict = additional_properties_object_instance.to_dict()
# create an instance of AdditionalPropertiesObject from a dict
additional_properties_object_form_dict = additional_properties_object.from_dict(additional_properties_object_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,28 @@
# AdditionalPropertiesWithDescriptionOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
## Example
```python
from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly
# TODO update the JSON string below
json = "{}"
# create an instance of AdditionalPropertiesWithDescriptionOnly from a JSON string
additional_properties_with_description_only_instance = AdditionalPropertiesWithDescriptionOnly.from_json(json)
# print the JSON string representation of the object
print AdditionalPropertiesWithDescriptionOnly.to_json()
# convert the object into a dict
additional_properties_with_description_only_dict = additional_properties_with_description_only_instance.to_dict()
# create an instance of AdditionalPropertiesWithDescriptionOnly from a dict
additional_properties_with_description_only_form_dict = additional_properties_with_description_only.from_dict(additional_properties_with_description_only_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

0
samples/openapi3/client/petstore/python/docs/Animal.md Executable file → Normal file
View File

View File

View File

View File

View File

View File

0
samples/openapi3/client/petstore/python/docs/Cat.md Executable file → Normal file
View File

View File

View File

0
samples/openapi3/client/petstore/python/docs/Client.md Executable file → Normal file
View File

View File

0
samples/openapi3/client/petstore/python/docs/Dog.md Executable file → Normal file
View File

View File

View File

View File

View File

0
samples/openapi3/client/petstore/python/docs/File.md Executable file → Normal file
View File

View File

0
samples/openapi3/client/petstore/python/docs/Foo.md Executable file → Normal file
View File

View File

View File

View File

View File

@ -1,11 +0,0 @@
# InlineObject
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | Updated name of the pet | [optional]
**status** | **str** | Updated status of the pet | [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)

Some files were not shown because too many files have changed in this diff Show More