mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-28 19:50:49 +00:00
[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:
parent
c080660cc1
commit
f6fb83878b
@ -149,7 +149,10 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
public String additionalPropertiesType;
|
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;
|
public boolean isAdditionalPropertiesTrue;
|
||||||
|
|
||||||
@ -1088,6 +1091,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
Objects.equals(externalDocumentation, that.externalDocumentation) &&
|
Objects.equals(externalDocumentation, that.externalDocumentation) &&
|
||||||
Objects.equals(vendorExtensions, that.vendorExtensions) &&
|
Objects.equals(vendorExtensions, that.vendorExtensions) &&
|
||||||
Objects.equals(additionalPropertiesType, that.additionalPropertiesType) &&
|
Objects.equals(additionalPropertiesType, that.additionalPropertiesType) &&
|
||||||
|
Objects.equals(isAdditionalPropertiesTrue, that.isAdditionalPropertiesTrue) &&
|
||||||
Objects.equals(getMaxProperties(), that.getMaxProperties()) &&
|
Objects.equals(getMaxProperties(), that.getMaxProperties()) &&
|
||||||
Objects.equals(getMinProperties(), that.getMinProperties()) &&
|
Objects.equals(getMinProperties(), that.getMinProperties()) &&
|
||||||
Objects.equals(getMaxItems(), that.getMaxItems()) &&
|
Objects.equals(getMaxItems(), that.getMaxItems()) &&
|
||||||
@ -1193,6 +1197,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
sb.append(", externalDocumentation=").append(externalDocumentation);
|
sb.append(", externalDocumentation=").append(externalDocumentation);
|
||||||
sb.append(", vendorExtensions=").append(vendorExtensions);
|
sb.append(", vendorExtensions=").append(vendorExtensions);
|
||||||
sb.append(", additionalPropertiesType='").append(additionalPropertiesType).append('\'');
|
sb.append(", additionalPropertiesType='").append(additionalPropertiesType).append('\'');
|
||||||
|
sb.append(", isAdditionalPropertiesTrue='").append(isAdditionalPropertiesTrue).append('\'');
|
||||||
sb.append(", maxProperties=").append(maxProperties);
|
sb.append(", maxProperties=").append(maxProperties);
|
||||||
sb.append(", minProperties=").append(minProperties);
|
sb.append(", minProperties=").append(minProperties);
|
||||||
sb.append(", uniqueItems=").append(uniqueItems);
|
sb.append(", uniqueItems=").append(uniqueItems);
|
||||||
|
@ -3179,6 +3179,9 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
// if we are trying to set additionalProperties on an empty schema stop recursing
|
// if we are trying to set additionalProperties on an empty schema stop recursing
|
||||||
return;
|
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;
|
boolean additionalPropertiesIsAnyType = false;
|
||||||
CodegenModel m = null;
|
CodegenModel m = null;
|
||||||
if (property instanceof CodegenModel) {
|
if (property instanceof CodegenModel) {
|
||||||
@ -3199,15 +3202,14 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
additionalPropertiesIsAnyType = true;
|
additionalPropertiesIsAnyType = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// if additioanl properties is set (e.g. free form object, any type, string, etc)
|
||||||
addPropProp = fromProperty(getAdditionalPropertiesName(), (Schema) schema.getAdditionalProperties(), false);
|
addPropProp = fromProperty(getAdditionalPropertiesName(), (Schema) schema.getAdditionalProperties(), false);
|
||||||
if (ModelUtils.isAnyType((Schema) schema.getAdditionalProperties())) {
|
additionalPropertiesIsAnyType = true;
|
||||||
additionalPropertiesIsAnyType = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (additionalPropertiesIsAnyType) {
|
if (additionalPropertiesIsAnyType) {
|
||||||
property.setAdditionalPropertiesIsAnyType(true);
|
property.setAdditionalPropertiesIsAnyType(true);
|
||||||
}
|
}
|
||||||
if (m != null && isAdditionalPropertiesTrue) {
|
if (m != null && (isAdditionalPropertiesTrue || additionalPropertiesIsAnyType)) {
|
||||||
m.isAdditionalPropertiesTrue = true;
|
m.isAdditionalPropertiesTrue = true;
|
||||||
}
|
}
|
||||||
if (ModelUtils.isComposedSchema(schema) && !supportsAdditionalPropertiesWithComposedSchema) {
|
if (ModelUtils.isComposedSchema(schema) && !supportsAdditionalPropertiesWithComposedSchema) {
|
||||||
|
@ -2616,7 +2616,7 @@ public class DefaultCodegenTest {
|
|||||||
cm = codegen.fromModel(modelName, sc);
|
cm = codegen.fromModel(modelName, sc);
|
||||||
CodegenProperty stringCp = codegen.fromProperty("additional_properties", new Schema().type("string"));
|
CodegenProperty stringCp = codegen.fromProperty("additional_properties", new Schema().type("string"));
|
||||||
assertEquals(cm.getAdditionalProperties(), stringCp);
|
assertEquals(cm.getAdditionalProperties(), stringCp);
|
||||||
assertFalse(cm.getAdditionalPropertiesIsAnyType());
|
assertTrue(cm.getAdditionalPropertiesIsAnyType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -2656,7 +2656,7 @@ public class DefaultCodegenTest {
|
|||||||
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
|
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
|
||||||
mapWithAddPropsSchema = cm.getVars().get(3);
|
mapWithAddPropsSchema = cm.getVars().get(3);
|
||||||
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
|
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
|
||||||
assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
|
assertTrue(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
|
||||||
|
|
||||||
modelName = "ObjectModelWithAddPropsInProps";
|
modelName = "ObjectModelWithAddPropsInProps";
|
||||||
sc = openAPI.getComponents().getSchemas().get(modelName);
|
sc = openAPI.getComponents().getSchemas().get(modelName);
|
||||||
@ -2672,7 +2672,7 @@ public class DefaultCodegenTest {
|
|||||||
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
|
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
|
||||||
mapWithAddPropsSchema = cm.getVars().get(3);
|
mapWithAddPropsSchema = cm.getVars().get(3);
|
||||||
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
|
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
|
||||||
assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
|
assertTrue(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
|
||||||
|
|
||||||
if (isGenerateAliasAsModel) { // restore the setting
|
if (isGenerateAliasAsModel) { // restore the setting
|
||||||
GlobalSettings.setProperty("generateAliasAsModel", "true");
|
GlobalSettings.setProperty("generateAliasAsModel", "true");
|
||||||
@ -2717,7 +2717,7 @@ public class DefaultCodegenTest {
|
|||||||
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
|
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
|
||||||
mapWithAddPropsSchema = co.queryParams.get(3);
|
mapWithAddPropsSchema = co.queryParams.get(3);
|
||||||
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
|
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
|
||||||
assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
|
assertTrue(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
|
||||||
|
|
||||||
path = "/additional_properties/";
|
path = "/additional_properties/";
|
||||||
operation = openAPI.getPaths().get(path).getPost();
|
operation = openAPI.getPaths().get(path).getPost();
|
||||||
@ -2733,7 +2733,7 @@ public class DefaultCodegenTest {
|
|||||||
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
|
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
|
||||||
mapWithAddPropsSchema = co.queryParams.get(3);
|
mapWithAddPropsSchema = co.queryParams.get(3);
|
||||||
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
|
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
|
||||||
assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
|
assertTrue(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
|
||||||
|
|
||||||
if (isGenerateAliasAsModel) { // restore the setting
|
if (isGenerateAliasAsModel) { // restore the setting
|
||||||
GlobalSettings.setProperty("generateAliasAsModel", "true");
|
GlobalSettings.setProperty("generateAliasAsModel", "true");
|
||||||
@ -2778,7 +2778,7 @@ public class DefaultCodegenTest {
|
|||||||
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
|
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
|
||||||
mapWithAddPropsSchema = co.responses.get(3);
|
mapWithAddPropsSchema = co.responses.get(3);
|
||||||
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
|
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
|
||||||
assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
|
assertTrue(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
|
||||||
|
|
||||||
path = "/additional_properties/";
|
path = "/additional_properties/";
|
||||||
operation = openAPI.getPaths().get(path).getPost();
|
operation = openAPI.getPaths().get(path).getPost();
|
||||||
@ -2794,7 +2794,7 @@ public class DefaultCodegenTest {
|
|||||||
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
|
assertFalse(mapWithAddPropsFalse.getAdditionalPropertiesIsAnyType());
|
||||||
mapWithAddPropsSchema = co.responses.get(3);
|
mapWithAddPropsSchema = co.responses.get(3);
|
||||||
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
|
assertEquals(mapWithAddPropsSchema.getAdditionalProperties(), stringCp);
|
||||||
assertFalse(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
|
assertTrue(mapWithAddPropsSchema.getAdditionalPropertiesIsAnyType());
|
||||||
|
|
||||||
if (isGenerateAliasAsModel) { // restore the setting
|
if (isGenerateAliasAsModel) { // restore the setting
|
||||||
GlobalSettings.setProperty("generateAliasAsModel", "true");
|
GlobalSettings.setProperty("generateAliasAsModel", "true");
|
||||||
|
@ -2272,4 +2272,23 @@ components:
|
|||||||
properties:
|
properties:
|
||||||
skill:
|
skill:
|
||||||
type: string
|
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
|
||||||
|
@ -61,6 +61,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
this._flagShapes = true;
|
this._flagShapes = true;
|
||||||
}
|
}
|
||||||
|
this.AdditionalProperties = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -159,6 +160,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
return _flagShapes;
|
return _flagShapes;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -172,6 +179,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
||||||
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
||||||
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -230,6 +238,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
|
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.AdditionalProperties != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||||
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -109,6 +109,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
this._flagObjectItemsNullable = true;
|
this._flagObjectItemsNullable = true;
|
||||||
}
|
}
|
||||||
|
this.AdditionalProperties = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -400,6 +401,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
return _flagObjectItemsNullable;
|
return _flagObjectItemsNullable;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -421,6 +428,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
|
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -511,6 +519,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
|
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.AdditionalProperties != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||||
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,6 +73,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[JsonPropertyName("shapeOrNull")]
|
[JsonPropertyName("shapeOrNull")]
|
||||||
public ShapeOrNull? ShapeOrNull { get; set; }
|
public ShapeOrNull? ShapeOrNull { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public Dictionary<string, JsonElement> AdditionalProperties { get; } = new Dictionary<string, JsonElement>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -86,6 +92,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
||||||
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
||||||
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
@ -137,6 +137,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[JsonPropertyName("string_prop")]
|
[JsonPropertyName("string_prop")]
|
||||||
public string? StringProp { get; set; }
|
public string? StringProp { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public Dictionary<string, JsonElement> AdditionalProperties { get; } = new Dictionary<string, JsonElement>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -158,6 +164,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
||||||
sb.Append(" StringProp: ").Append(StringProp).Append("\n");
|
sb.Append(" StringProp: ").Append(StringProp).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[JsonPropertyName("shapeOrNull")]
|
[JsonPropertyName("shapeOrNull")]
|
||||||
public ShapeOrNull ShapeOrNull { get; set; }
|
public ShapeOrNull ShapeOrNull { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public Dictionary<string, JsonElement> AdditionalProperties { get; } = new Dictionary<string, JsonElement>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -84,6 +90,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
||||||
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
||||||
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
@ -135,6 +135,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[JsonPropertyName("string_prop")]
|
[JsonPropertyName("string_prop")]
|
||||||
public string StringProp { get; set; }
|
public string StringProp { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public Dictionary<string, JsonElement> AdditionalProperties { get; } = new Dictionary<string, JsonElement>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -156,6 +162,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
||||||
sb.Append(" StringProp: ").Append(StringProp).Append("\n");
|
sb.Append(" StringProp: ").Append(StringProp).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[JsonPropertyName("shapeOrNull")]
|
[JsonPropertyName("shapeOrNull")]
|
||||||
public ShapeOrNull ShapeOrNull { get; set; }
|
public ShapeOrNull ShapeOrNull { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public Dictionary<string, JsonElement> AdditionalProperties { get; } = new Dictionary<string, JsonElement>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -84,6 +90,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
||||||
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
||||||
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
@ -135,6 +135,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[JsonPropertyName("string_prop")]
|
[JsonPropertyName("string_prop")]
|
||||||
public string StringProp { get; set; }
|
public string StringProp { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public Dictionary<string, JsonElement> AdditionalProperties { get; } = new Dictionary<string, JsonElement>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -156,6 +162,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
||||||
sb.Append(" StringProp: ").Append(StringProp).Append("\n");
|
sb.Append(" StringProp: ").Append(StringProp).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
this.ShapeOrNull = shapeOrNull;
|
this.ShapeOrNull = shapeOrNull;
|
||||||
this.NullableShape = nullableShape;
|
this.NullableShape = nullableShape;
|
||||||
this.Shapes = shapes;
|
this.Shapes = shapes;
|
||||||
|
this.AdditionalProperties = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -72,6 +73,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[DataMember(Name = "shapes", EmitDefaultValue = false)]
|
[DataMember(Name = "shapes", EmitDefaultValue = false)]
|
||||||
public List<Shape> Shapes { get; set; }
|
public List<Shape> Shapes { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -85,6 +92,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
||||||
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
||||||
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -143,6 +151,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
|
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.AdditionalProperties != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||||
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
this.ObjectNullableProp = objectNullableProp;
|
this.ObjectNullableProp = objectNullableProp;
|
||||||
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
|
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
|
||||||
this.ObjectItemsNullable = objectItemsNullable;
|
this.ObjectItemsNullable = objectItemsNullable;
|
||||||
|
this.AdditionalProperties = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -137,6 +138,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
|
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
|
||||||
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
|
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -158,6 +165,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
|
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -248,6 +256,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
|
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.AdditionalProperties != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||||
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
this.ShapeOrNull = shapeOrNull;
|
this.ShapeOrNull = shapeOrNull;
|
||||||
this.NullableShape = nullableShape;
|
this.NullableShape = nullableShape;
|
||||||
this.Shapes = shapes;
|
this.Shapes = shapes;
|
||||||
|
this.AdditionalProperties = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -71,6 +72,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[DataMember(Name = "shapes", EmitDefaultValue = false)]
|
[DataMember(Name = "shapes", EmitDefaultValue = false)]
|
||||||
public List<Shape> Shapes { get; set; }
|
public List<Shape> Shapes { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -84,6 +91,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
||||||
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
||||||
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -142,6 +150,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
|
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.AdditionalProperties != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||||
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
this.ObjectNullableProp = objectNullableProp;
|
this.ObjectNullableProp = objectNullableProp;
|
||||||
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
|
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
|
||||||
this.ObjectItemsNullable = objectItemsNullable;
|
this.ObjectItemsNullable = objectItemsNullable;
|
||||||
|
this.AdditionalProperties = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -136,6 +137,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
|
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
|
||||||
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
|
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -157,6 +164,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
|
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -247,6 +255,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
|
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.AdditionalProperties != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||||
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
this.ShapeOrNull = shapeOrNull;
|
this.ShapeOrNull = shapeOrNull;
|
||||||
this.NullableShape = nullableShape;
|
this.NullableShape = nullableShape;
|
||||||
this.Shapes = shapes;
|
this.Shapes = shapes;
|
||||||
|
this.AdditionalProperties = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -71,6 +72,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[DataMember(Name = "shapes", EmitDefaultValue = false)]
|
[DataMember(Name = "shapes", EmitDefaultValue = false)]
|
||||||
public List<Shape> Shapes { get; set; }
|
public List<Shape> Shapes { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -84,6 +91,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
||||||
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
||||||
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -142,6 +150,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
|
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.AdditionalProperties != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||||
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
this.ObjectNullableProp = objectNullableProp;
|
this.ObjectNullableProp = objectNullableProp;
|
||||||
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
|
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
|
||||||
this.ObjectItemsNullable = objectItemsNullable;
|
this.ObjectItemsNullable = objectItemsNullable;
|
||||||
|
this.AdditionalProperties = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -136,6 +137,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
|
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
|
||||||
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
|
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -157,6 +164,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
|
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -247,6 +255,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
|
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.AdditionalProperties != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||||
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
this.ShapeOrNull = shapeOrNull;
|
this.ShapeOrNull = shapeOrNull;
|
||||||
this.NullableShape = nullableShape;
|
this.NullableShape = nullableShape;
|
||||||
this.Shapes = shapes;
|
this.Shapes = shapes;
|
||||||
|
this.AdditionalProperties = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -71,6 +72,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[DataMember(Name = "shapes", EmitDefaultValue = false)]
|
[DataMember(Name = "shapes", EmitDefaultValue = false)]
|
||||||
public List<Shape> Shapes { get; set; }
|
public List<Shape> Shapes { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -84,6 +91,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
||||||
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
||||||
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -142,6 +150,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
|
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.AdditionalProperties != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||||
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
this.ObjectNullableProp = objectNullableProp;
|
this.ObjectNullableProp = objectNullableProp;
|
||||||
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
|
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
|
||||||
this.ObjectItemsNullable = objectItemsNullable;
|
this.ObjectItemsNullable = objectItemsNullable;
|
||||||
|
this.AdditionalProperties = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -136,6 +137,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
|
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
|
||||||
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
|
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -157,6 +164,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
|
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -247,6 +255,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
|
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.AdditionalProperties != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||||
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
this.ShapeOrNull = shapeOrNull;
|
this.ShapeOrNull = shapeOrNull;
|
||||||
this.NullableShape = nullableShape;
|
this.NullableShape = nullableShape;
|
||||||
this.Shapes = shapes;
|
this.Shapes = shapes;
|
||||||
|
this.AdditionalProperties = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -69,6 +70,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[DataMember(Name = "shapes", EmitDefaultValue = false)]
|
[DataMember(Name = "shapes", EmitDefaultValue = false)]
|
||||||
public List<Shape> Shapes { get; set; }
|
public List<Shape> Shapes { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -82,6 +89,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
||||||
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
||||||
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -137,7 +145,8 @@ namespace Org.OpenAPITools.Model
|
|||||||
this.Shapes != null &&
|
this.Shapes != null &&
|
||||||
input.Shapes != null &&
|
input.Shapes != null &&
|
||||||
this.Shapes.SequenceEqual(input.Shapes)
|
this.Shapes.SequenceEqual(input.Shapes)
|
||||||
);
|
)
|
||||||
|
&& (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -165,6 +174,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
|
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.AdditionalProperties != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||||
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
this.ObjectNullableProp = objectNullableProp;
|
this.ObjectNullableProp = objectNullableProp;
|
||||||
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
|
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
|
||||||
this.ObjectItemsNullable = objectItemsNullable;
|
this.ObjectItemsNullable = objectItemsNullable;
|
||||||
|
this.AdditionalProperties = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -134,6 +135,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
|
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
|
||||||
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
|
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -155,6 +162,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
|
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -255,7 +263,8 @@ namespace Org.OpenAPITools.Model
|
|||||||
this.ObjectItemsNullable != null &&
|
this.ObjectItemsNullable != null &&
|
||||||
input.ObjectItemsNullable != null &&
|
input.ObjectItemsNullable != null &&
|
||||||
this.ObjectItemsNullable.SequenceEqual(input.ObjectItemsNullable)
|
this.ObjectItemsNullable.SequenceEqual(input.ObjectItemsNullable)
|
||||||
);
|
)
|
||||||
|
&& (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -315,6 +324,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
|
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.AdditionalProperties != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||||
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
this.ShapeOrNull = shapeOrNull;
|
this.ShapeOrNull = shapeOrNull;
|
||||||
this.NullableShape = nullableShape;
|
this.NullableShape = nullableShape;
|
||||||
this.Shapes = shapes;
|
this.Shapes = shapes;
|
||||||
|
this.AdditionalProperties = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -71,6 +72,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[DataMember(Name = "shapes", EmitDefaultValue = false)]
|
[DataMember(Name = "shapes", EmitDefaultValue = false)]
|
||||||
public List<Shape> Shapes { get; set; }
|
public List<Shape> Shapes { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -84,6 +91,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
||||||
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
||||||
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -142,6 +150,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
|
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.AdditionalProperties != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||||
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
this.ObjectNullableProp = objectNullableProp;
|
this.ObjectNullableProp = objectNullableProp;
|
||||||
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
|
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
|
||||||
this.ObjectItemsNullable = objectItemsNullable;
|
this.ObjectItemsNullable = objectItemsNullable;
|
||||||
|
this.AdditionalProperties = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -136,6 +137,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
|
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
|
||||||
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
|
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -157,6 +164,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
|
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -247,6 +255,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
|
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.AdditionalProperties != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||||
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
this.ShapeOrNull = shapeOrNull;
|
this.ShapeOrNull = shapeOrNull;
|
||||||
this.NullableShape = nullableShape;
|
this.NullableShape = nullableShape;
|
||||||
this.Shapes = shapes;
|
this.Shapes = shapes;
|
||||||
|
this.AdditionalProperties = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -71,6 +72,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[DataMember(Name = "shapes", EmitDefaultValue = false)]
|
[DataMember(Name = "shapes", EmitDefaultValue = false)]
|
||||||
public List<Shape> Shapes { get; set; }
|
public List<Shape> Shapes { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -84,6 +91,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
sb.Append(" ShapeOrNull: ").Append(ShapeOrNull).Append("\n");
|
||||||
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
sb.Append(" NullableShape: ").Append(NullableShape).Append("\n");
|
||||||
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
sb.Append(" Shapes: ").Append(Shapes).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -142,6 +150,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
|
hashCode = (hashCode * 59) + this.Shapes.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.AdditionalProperties != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||||
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
this.ObjectNullableProp = objectNullableProp;
|
this.ObjectNullableProp = objectNullableProp;
|
||||||
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
|
this.ObjectAndItemsNullableProp = objectAndItemsNullableProp;
|
||||||
this.ObjectItemsNullable = objectItemsNullable;
|
this.ObjectItemsNullable = objectItemsNullable;
|
||||||
|
this.AdditionalProperties = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -136,6 +137,12 @@ namespace Org.OpenAPITools.Model
|
|||||||
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
|
[DataMember(Name = "object_items_nullable", EmitDefaultValue = false)]
|
||||||
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
|
public Dictionary<string, Object> ObjectItemsNullable { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets additional properties
|
||||||
|
/// </summary>
|
||||||
|
[JsonExtensionData]
|
||||||
|
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the string presentation of the object
|
/// Returns the string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -157,6 +164,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
sb.Append(" ObjectNullableProp: ").Append(ObjectNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
sb.Append(" ObjectAndItemsNullableProp: ").Append(ObjectAndItemsNullableProp).Append("\n");
|
||||||
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
|
sb.Append(" ObjectItemsNullable: ").Append(ObjectItemsNullable).Append("\n");
|
||||||
|
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||||
sb.Append("}\n");
|
sb.Append("}\n");
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
@ -247,6 +255,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
|
hashCode = (hashCode * 59) + this.ObjectItemsNullable.GetHashCode();
|
||||||
}
|
}
|
||||||
|
if (this.AdditionalProperties != null)
|
||||||
|
{
|
||||||
|
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||||
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,11 @@ var _ MappedNullable = &AdditionalPropertiesAnyType{}
|
|||||||
// AdditionalPropertiesAnyType struct for AdditionalPropertiesAnyType
|
// AdditionalPropertiesAnyType struct for AdditionalPropertiesAnyType
|
||||||
type AdditionalPropertiesAnyType struct {
|
type AdditionalPropertiesAnyType struct {
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty"`
|
||||||
|
AdditionalProperties map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type _AdditionalPropertiesAnyType AdditionalPropertiesAnyType
|
||||||
|
|
||||||
// NewAdditionalPropertiesAnyType instantiates a new AdditionalPropertiesAnyType object
|
// NewAdditionalPropertiesAnyType instantiates a new AdditionalPropertiesAnyType object
|
||||||
// This constructor will assign default values to properties that have it defined,
|
// 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
|
// 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) {
|
if !IsNil(o.Name) {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for key, value := range o.AdditionalProperties {
|
||||||
|
toSerialize[key] = value
|
||||||
|
}
|
||||||
|
|
||||||
return toSerialize, nil
|
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 {
|
type NullableAdditionalPropertiesAnyType struct {
|
||||||
value *AdditionalPropertiesAnyType
|
value *AdditionalPropertiesAnyType
|
||||||
isSet bool
|
isSet bool
|
||||||
|
@ -20,8 +20,11 @@ var _ MappedNullable = &AdditionalPropertiesArray{}
|
|||||||
// AdditionalPropertiesArray struct for AdditionalPropertiesArray
|
// AdditionalPropertiesArray struct for AdditionalPropertiesArray
|
||||||
type AdditionalPropertiesArray struct {
|
type AdditionalPropertiesArray struct {
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty"`
|
||||||
|
AdditionalProperties map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type _AdditionalPropertiesArray AdditionalPropertiesArray
|
||||||
|
|
||||||
// NewAdditionalPropertiesArray instantiates a new AdditionalPropertiesArray object
|
// NewAdditionalPropertiesArray instantiates a new AdditionalPropertiesArray object
|
||||||
// This constructor will assign default values to properties that have it defined,
|
// 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
|
// 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) {
|
if !IsNil(o.Name) {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for key, value := range o.AdditionalProperties {
|
||||||
|
toSerialize[key] = value
|
||||||
|
}
|
||||||
|
|
||||||
return toSerialize, nil
|
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 {
|
type NullableAdditionalPropertiesArray struct {
|
||||||
value *AdditionalPropertiesArray
|
value *AdditionalPropertiesArray
|
||||||
isSet bool
|
isSet bool
|
||||||
|
@ -20,8 +20,11 @@ var _ MappedNullable = &AdditionalPropertiesBoolean{}
|
|||||||
// AdditionalPropertiesBoolean struct for AdditionalPropertiesBoolean
|
// AdditionalPropertiesBoolean struct for AdditionalPropertiesBoolean
|
||||||
type AdditionalPropertiesBoolean struct {
|
type AdditionalPropertiesBoolean struct {
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty"`
|
||||||
|
AdditionalProperties map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type _AdditionalPropertiesBoolean AdditionalPropertiesBoolean
|
||||||
|
|
||||||
// NewAdditionalPropertiesBoolean instantiates a new AdditionalPropertiesBoolean object
|
// NewAdditionalPropertiesBoolean instantiates a new AdditionalPropertiesBoolean object
|
||||||
// This constructor will assign default values to properties that have it defined,
|
// 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
|
// 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) {
|
if !IsNil(o.Name) {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for key, value := range o.AdditionalProperties {
|
||||||
|
toSerialize[key] = value
|
||||||
|
}
|
||||||
|
|
||||||
return toSerialize, nil
|
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 {
|
type NullableAdditionalPropertiesBoolean struct {
|
||||||
value *AdditionalPropertiesBoolean
|
value *AdditionalPropertiesBoolean
|
||||||
isSet bool
|
isSet bool
|
||||||
|
@ -20,8 +20,11 @@ var _ MappedNullable = &AdditionalPropertiesInteger{}
|
|||||||
// AdditionalPropertiesInteger struct for AdditionalPropertiesInteger
|
// AdditionalPropertiesInteger struct for AdditionalPropertiesInteger
|
||||||
type AdditionalPropertiesInteger struct {
|
type AdditionalPropertiesInteger struct {
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty"`
|
||||||
|
AdditionalProperties map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type _AdditionalPropertiesInteger AdditionalPropertiesInteger
|
||||||
|
|
||||||
// NewAdditionalPropertiesInteger instantiates a new AdditionalPropertiesInteger object
|
// NewAdditionalPropertiesInteger instantiates a new AdditionalPropertiesInteger object
|
||||||
// This constructor will assign default values to properties that have it defined,
|
// 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
|
// 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) {
|
if !IsNil(o.Name) {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for key, value := range o.AdditionalProperties {
|
||||||
|
toSerialize[key] = value
|
||||||
|
}
|
||||||
|
|
||||||
return toSerialize, nil
|
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 {
|
type NullableAdditionalPropertiesInteger struct {
|
||||||
value *AdditionalPropertiesInteger
|
value *AdditionalPropertiesInteger
|
||||||
isSet bool
|
isSet bool
|
||||||
|
@ -20,8 +20,11 @@ var _ MappedNullable = &AdditionalPropertiesNumber{}
|
|||||||
// AdditionalPropertiesNumber struct for AdditionalPropertiesNumber
|
// AdditionalPropertiesNumber struct for AdditionalPropertiesNumber
|
||||||
type AdditionalPropertiesNumber struct {
|
type AdditionalPropertiesNumber struct {
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty"`
|
||||||
|
AdditionalProperties map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type _AdditionalPropertiesNumber AdditionalPropertiesNumber
|
||||||
|
|
||||||
// NewAdditionalPropertiesNumber instantiates a new AdditionalPropertiesNumber object
|
// NewAdditionalPropertiesNumber instantiates a new AdditionalPropertiesNumber object
|
||||||
// This constructor will assign default values to properties that have it defined,
|
// 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
|
// 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) {
|
if !IsNil(o.Name) {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for key, value := range o.AdditionalProperties {
|
||||||
|
toSerialize[key] = value
|
||||||
|
}
|
||||||
|
|
||||||
return toSerialize, nil
|
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 {
|
type NullableAdditionalPropertiesNumber struct {
|
||||||
value *AdditionalPropertiesNumber
|
value *AdditionalPropertiesNumber
|
||||||
isSet bool
|
isSet bool
|
||||||
|
@ -20,8 +20,11 @@ var _ MappedNullable = &AdditionalPropertiesObject{}
|
|||||||
// AdditionalPropertiesObject struct for AdditionalPropertiesObject
|
// AdditionalPropertiesObject struct for AdditionalPropertiesObject
|
||||||
type AdditionalPropertiesObject struct {
|
type AdditionalPropertiesObject struct {
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty"`
|
||||||
|
AdditionalProperties map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type _AdditionalPropertiesObject AdditionalPropertiesObject
|
||||||
|
|
||||||
// NewAdditionalPropertiesObject instantiates a new AdditionalPropertiesObject object
|
// NewAdditionalPropertiesObject instantiates a new AdditionalPropertiesObject object
|
||||||
// This constructor will assign default values to properties that have it defined,
|
// 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
|
// 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) {
|
if !IsNil(o.Name) {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for key, value := range o.AdditionalProperties {
|
||||||
|
toSerialize[key] = value
|
||||||
|
}
|
||||||
|
|
||||||
return toSerialize, nil
|
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 {
|
type NullableAdditionalPropertiesObject struct {
|
||||||
value *AdditionalPropertiesObject
|
value *AdditionalPropertiesObject
|
||||||
isSet bool
|
isSet bool
|
||||||
|
@ -20,8 +20,11 @@ var _ MappedNullable = &AdditionalPropertiesString{}
|
|||||||
// AdditionalPropertiesString struct for AdditionalPropertiesString
|
// AdditionalPropertiesString struct for AdditionalPropertiesString
|
||||||
type AdditionalPropertiesString struct {
|
type AdditionalPropertiesString struct {
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty"`
|
||||||
|
AdditionalProperties map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type _AdditionalPropertiesString AdditionalPropertiesString
|
||||||
|
|
||||||
// NewAdditionalPropertiesString instantiates a new AdditionalPropertiesString object
|
// NewAdditionalPropertiesString instantiates a new AdditionalPropertiesString object
|
||||||
// This constructor will assign default values to properties that have it defined,
|
// 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
|
// 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) {
|
if !IsNil(o.Name) {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for key, value := range o.AdditionalProperties {
|
||||||
|
toSerialize[key] = value
|
||||||
|
}
|
||||||
|
|
||||||
return toSerialize, nil
|
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 {
|
type NullableAdditionalPropertiesString struct {
|
||||||
value *AdditionalPropertiesString
|
value *AdditionalPropertiesString
|
||||||
isSet bool
|
isSet bool
|
||||||
|
@ -79,6 +79,50 @@ public class AdditionalPropertiesAnyType {
|
|||||||
this.name = name;
|
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
|
@Override
|
||||||
@ -90,12 +134,13 @@ public class AdditionalPropertiesAnyType {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o;
|
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
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(name);
|
return Objects.hash(name, additionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -103,6 +148,7 @@ public class AdditionalPropertiesAnyType {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("class AdditionalPropertiesAnyType {\n");
|
sb.append("class AdditionalPropertiesAnyType {\n");
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||||
|
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
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()));
|
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();
|
JsonObject jsonObj = jsonElement.getAsJsonObject();
|
||||||
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
|
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()));
|
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
|
@Override
|
||||||
public void write(JsonWriter out, AdditionalPropertiesAnyType value) throws IOException {
|
public void write(JsonWriter out, AdditionalPropertiesAnyType value) throws IOException {
|
||||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
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);
|
elementAdapter.write(out, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,7 +234,28 @@ public class AdditionalPropertiesAnyType {
|
|||||||
public AdditionalPropertiesAnyType read(JsonReader in) throws IOException {
|
public AdditionalPropertiesAnyType read(JsonReader in) throws IOException {
|
||||||
JsonElement jsonElement = elementAdapter.read(in);
|
JsonElement jsonElement = elementAdapter.read(in);
|
||||||
validateJsonElement(jsonElement);
|
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();
|
}.nullSafe();
|
||||||
|
@ -80,6 +80,50 @@ public class AdditionalPropertiesArray {
|
|||||||
this.name = name;
|
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
|
@Override
|
||||||
@ -91,12 +135,13 @@ public class AdditionalPropertiesArray {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o;
|
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
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(name);
|
return Objects.hash(name, additionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -104,6 +149,7 @@ public class AdditionalPropertiesArray {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("class AdditionalPropertiesArray {\n");
|
sb.append("class AdditionalPropertiesArray {\n");
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||||
|
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
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()));
|
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();
|
JsonObject jsonObj = jsonElement.getAsJsonObject();
|
||||||
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
|
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()));
|
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
|
@Override
|
||||||
public void write(JsonWriter out, AdditionalPropertiesArray value) throws IOException {
|
public void write(JsonWriter out, AdditionalPropertiesArray value) throws IOException {
|
||||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
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);
|
elementAdapter.write(out, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,7 +235,28 @@ public class AdditionalPropertiesArray {
|
|||||||
public AdditionalPropertiesArray read(JsonReader in) throws IOException {
|
public AdditionalPropertiesArray read(JsonReader in) throws IOException {
|
||||||
JsonElement jsonElement = elementAdapter.read(in);
|
JsonElement jsonElement = elementAdapter.read(in);
|
||||||
validateJsonElement(jsonElement);
|
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();
|
}.nullSafe();
|
||||||
|
@ -79,6 +79,50 @@ public class AdditionalPropertiesBoolean {
|
|||||||
this.name = name;
|
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
|
@Override
|
||||||
@ -90,12 +134,13 @@ public class AdditionalPropertiesBoolean {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o;
|
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
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(name);
|
return Objects.hash(name, additionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -103,6 +148,7 @@ public class AdditionalPropertiesBoolean {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("class AdditionalPropertiesBoolean {\n");
|
sb.append("class AdditionalPropertiesBoolean {\n");
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||||
|
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
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()));
|
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();
|
JsonObject jsonObj = jsonElement.getAsJsonObject();
|
||||||
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
|
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()));
|
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
|
@Override
|
||||||
public void write(JsonWriter out, AdditionalPropertiesBoolean value) throws IOException {
|
public void write(JsonWriter out, AdditionalPropertiesBoolean value) throws IOException {
|
||||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
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);
|
elementAdapter.write(out, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,7 +234,28 @@ public class AdditionalPropertiesBoolean {
|
|||||||
public AdditionalPropertiesBoolean read(JsonReader in) throws IOException {
|
public AdditionalPropertiesBoolean read(JsonReader in) throws IOException {
|
||||||
JsonElement jsonElement = elementAdapter.read(in);
|
JsonElement jsonElement = elementAdapter.read(in);
|
||||||
validateJsonElement(jsonElement);
|
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();
|
}.nullSafe();
|
||||||
|
@ -79,6 +79,50 @@ public class AdditionalPropertiesInteger {
|
|||||||
this.name = name;
|
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
|
@Override
|
||||||
@ -90,12 +134,13 @@ public class AdditionalPropertiesInteger {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o;
|
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
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(name);
|
return Objects.hash(name, additionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -103,6 +148,7 @@ public class AdditionalPropertiesInteger {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("class AdditionalPropertiesInteger {\n");
|
sb.append("class AdditionalPropertiesInteger {\n");
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||||
|
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
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()));
|
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();
|
JsonObject jsonObj = jsonElement.getAsJsonObject();
|
||||||
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
|
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()));
|
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
|
@Override
|
||||||
public void write(JsonWriter out, AdditionalPropertiesInteger value) throws IOException {
|
public void write(JsonWriter out, AdditionalPropertiesInteger value) throws IOException {
|
||||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
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);
|
elementAdapter.write(out, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,7 +234,28 @@ public class AdditionalPropertiesInteger {
|
|||||||
public AdditionalPropertiesInteger read(JsonReader in) throws IOException {
|
public AdditionalPropertiesInteger read(JsonReader in) throws IOException {
|
||||||
JsonElement jsonElement = elementAdapter.read(in);
|
JsonElement jsonElement = elementAdapter.read(in);
|
||||||
validateJsonElement(jsonElement);
|
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();
|
}.nullSafe();
|
||||||
|
@ -80,6 +80,50 @@ public class AdditionalPropertiesNumber {
|
|||||||
this.name = name;
|
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
|
@Override
|
||||||
@ -91,12 +135,13 @@ public class AdditionalPropertiesNumber {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o;
|
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
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(name);
|
return Objects.hash(name, additionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -104,6 +149,7 @@ public class AdditionalPropertiesNumber {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("class AdditionalPropertiesNumber {\n");
|
sb.append("class AdditionalPropertiesNumber {\n");
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||||
|
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
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()));
|
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();
|
JsonObject jsonObj = jsonElement.getAsJsonObject();
|
||||||
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
|
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()));
|
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
|
@Override
|
||||||
public void write(JsonWriter out, AdditionalPropertiesNumber value) throws IOException {
|
public void write(JsonWriter out, AdditionalPropertiesNumber value) throws IOException {
|
||||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
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);
|
elementAdapter.write(out, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,7 +235,28 @@ public class AdditionalPropertiesNumber {
|
|||||||
public AdditionalPropertiesNumber read(JsonReader in) throws IOException {
|
public AdditionalPropertiesNumber read(JsonReader in) throws IOException {
|
||||||
JsonElement jsonElement = elementAdapter.read(in);
|
JsonElement jsonElement = elementAdapter.read(in);
|
||||||
validateJsonElement(jsonElement);
|
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();
|
}.nullSafe();
|
||||||
|
@ -80,6 +80,50 @@ public class AdditionalPropertiesObject {
|
|||||||
this.name = name;
|
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
|
@Override
|
||||||
@ -91,12 +135,13 @@ public class AdditionalPropertiesObject {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o;
|
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
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(name);
|
return Objects.hash(name, additionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -104,6 +149,7 @@ public class AdditionalPropertiesObject {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("class AdditionalPropertiesObject {\n");
|
sb.append("class AdditionalPropertiesObject {\n");
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||||
|
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
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()));
|
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();
|
JsonObject jsonObj = jsonElement.getAsJsonObject();
|
||||||
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
|
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()));
|
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
|
@Override
|
||||||
public void write(JsonWriter out, AdditionalPropertiesObject value) throws IOException {
|
public void write(JsonWriter out, AdditionalPropertiesObject value) throws IOException {
|
||||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
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);
|
elementAdapter.write(out, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,7 +235,28 @@ public class AdditionalPropertiesObject {
|
|||||||
public AdditionalPropertiesObject read(JsonReader in) throws IOException {
|
public AdditionalPropertiesObject read(JsonReader in) throws IOException {
|
||||||
JsonElement jsonElement = elementAdapter.read(in);
|
JsonElement jsonElement = elementAdapter.read(in);
|
||||||
validateJsonElement(jsonElement);
|
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();
|
}.nullSafe();
|
||||||
|
@ -79,6 +79,50 @@ public class AdditionalPropertiesString {
|
|||||||
this.name = name;
|
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
|
@Override
|
||||||
@ -90,12 +134,13 @@ public class AdditionalPropertiesString {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o;
|
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
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(name);
|
return Objects.hash(name, additionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -103,6 +148,7 @@ public class AdditionalPropertiesString {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("class AdditionalPropertiesString {\n");
|
sb.append("class AdditionalPropertiesString {\n");
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||||
|
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
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()));
|
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();
|
JsonObject jsonObj = jsonElement.getAsJsonObject();
|
||||||
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
|
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()));
|
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
|
@Override
|
||||||
public void write(JsonWriter out, AdditionalPropertiesString value) throws IOException {
|
public void write(JsonWriter out, AdditionalPropertiesString value) throws IOException {
|
||||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
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);
|
elementAdapter.write(out, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,7 +234,28 @@ public class AdditionalPropertiesString {
|
|||||||
public AdditionalPropertiesString read(JsonReader in) throws IOException {
|
public AdditionalPropertiesString read(JsonReader in) throws IOException {
|
||||||
JsonElement jsonElement = elementAdapter.read(in);
|
JsonElement jsonElement = elementAdapter.read(in);
|
||||||
validateJsonElement(jsonElement);
|
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();
|
}.nullSafe();
|
||||||
|
@ -81,6 +81,50 @@ public class AdditionalPropertiesAnyType implements Parcelable {
|
|||||||
this.name = name;
|
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
|
@Override
|
||||||
@ -92,12 +136,13 @@ public class AdditionalPropertiesAnyType implements Parcelable {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o;
|
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
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(name);
|
return Objects.hash(name, additionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -105,6 +150,7 @@ public class AdditionalPropertiesAnyType implements Parcelable {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("class AdditionalPropertiesAnyType {\n");
|
sb.append("class AdditionalPropertiesAnyType {\n");
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||||
|
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
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()));
|
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();
|
JsonObject jsonObj = jsonElement.getAsJsonObject();
|
||||||
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
|
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()));
|
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
|
@Override
|
||||||
public void write(JsonWriter out, AdditionalPropertiesAnyType value) throws IOException {
|
public void write(JsonWriter out, AdditionalPropertiesAnyType value) throws IOException {
|
||||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
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);
|
elementAdapter.write(out, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,7 +257,28 @@ public class AdditionalPropertiesAnyType implements Parcelable {
|
|||||||
public AdditionalPropertiesAnyType read(JsonReader in) throws IOException {
|
public AdditionalPropertiesAnyType read(JsonReader in) throws IOException {
|
||||||
JsonElement jsonElement = elementAdapter.read(in);
|
JsonElement jsonElement = elementAdapter.read(in);
|
||||||
validateJsonElement(jsonElement);
|
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();
|
}.nullSafe();
|
||||||
|
@ -82,6 +82,50 @@ public class AdditionalPropertiesArray implements Parcelable {
|
|||||||
this.name = name;
|
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
|
@Override
|
||||||
@ -93,12 +137,13 @@ public class AdditionalPropertiesArray implements Parcelable {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o;
|
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
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(name);
|
return Objects.hash(name, additionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -106,6 +151,7 @@ public class AdditionalPropertiesArray implements Parcelable {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("class AdditionalPropertiesArray {\n");
|
sb.append("class AdditionalPropertiesArray {\n");
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||||
|
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
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()));
|
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();
|
JsonObject jsonObj = jsonElement.getAsJsonObject();
|
||||||
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
|
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()));
|
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
|
@Override
|
||||||
public void write(JsonWriter out, AdditionalPropertiesArray value) throws IOException {
|
public void write(JsonWriter out, AdditionalPropertiesArray value) throws IOException {
|
||||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
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);
|
elementAdapter.write(out, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,7 +258,28 @@ public class AdditionalPropertiesArray implements Parcelable {
|
|||||||
public AdditionalPropertiesArray read(JsonReader in) throws IOException {
|
public AdditionalPropertiesArray read(JsonReader in) throws IOException {
|
||||||
JsonElement jsonElement = elementAdapter.read(in);
|
JsonElement jsonElement = elementAdapter.read(in);
|
||||||
validateJsonElement(jsonElement);
|
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();
|
}.nullSafe();
|
||||||
|
@ -81,6 +81,50 @@ public class AdditionalPropertiesBoolean implements Parcelable {
|
|||||||
this.name = name;
|
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
|
@Override
|
||||||
@ -92,12 +136,13 @@ public class AdditionalPropertiesBoolean implements Parcelable {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o;
|
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
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(name);
|
return Objects.hash(name, additionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -105,6 +150,7 @@ public class AdditionalPropertiesBoolean implements Parcelable {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("class AdditionalPropertiesBoolean {\n");
|
sb.append("class AdditionalPropertiesBoolean {\n");
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||||
|
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
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()));
|
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();
|
JsonObject jsonObj = jsonElement.getAsJsonObject();
|
||||||
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
|
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()));
|
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
|
@Override
|
||||||
public void write(JsonWriter out, AdditionalPropertiesBoolean value) throws IOException {
|
public void write(JsonWriter out, AdditionalPropertiesBoolean value) throws IOException {
|
||||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
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);
|
elementAdapter.write(out, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,7 +257,28 @@ public class AdditionalPropertiesBoolean implements Parcelable {
|
|||||||
public AdditionalPropertiesBoolean read(JsonReader in) throws IOException {
|
public AdditionalPropertiesBoolean read(JsonReader in) throws IOException {
|
||||||
JsonElement jsonElement = elementAdapter.read(in);
|
JsonElement jsonElement = elementAdapter.read(in);
|
||||||
validateJsonElement(jsonElement);
|
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();
|
}.nullSafe();
|
||||||
|
@ -81,6 +81,50 @@ public class AdditionalPropertiesInteger implements Parcelable {
|
|||||||
this.name = name;
|
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
|
@Override
|
||||||
@ -92,12 +136,13 @@ public class AdditionalPropertiesInteger implements Parcelable {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o;
|
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
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(name);
|
return Objects.hash(name, additionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -105,6 +150,7 @@ public class AdditionalPropertiesInteger implements Parcelable {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("class AdditionalPropertiesInteger {\n");
|
sb.append("class AdditionalPropertiesInteger {\n");
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||||
|
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
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()));
|
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();
|
JsonObject jsonObj = jsonElement.getAsJsonObject();
|
||||||
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
|
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()));
|
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
|
@Override
|
||||||
public void write(JsonWriter out, AdditionalPropertiesInteger value) throws IOException {
|
public void write(JsonWriter out, AdditionalPropertiesInteger value) throws IOException {
|
||||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
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);
|
elementAdapter.write(out, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,7 +257,28 @@ public class AdditionalPropertiesInteger implements Parcelable {
|
|||||||
public AdditionalPropertiesInteger read(JsonReader in) throws IOException {
|
public AdditionalPropertiesInteger read(JsonReader in) throws IOException {
|
||||||
JsonElement jsonElement = elementAdapter.read(in);
|
JsonElement jsonElement = elementAdapter.read(in);
|
||||||
validateJsonElement(jsonElement);
|
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();
|
}.nullSafe();
|
||||||
|
@ -82,6 +82,50 @@ public class AdditionalPropertiesNumber implements Parcelable {
|
|||||||
this.name = name;
|
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
|
@Override
|
||||||
@ -93,12 +137,13 @@ public class AdditionalPropertiesNumber implements Parcelable {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o;
|
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
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(name);
|
return Objects.hash(name, additionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -106,6 +151,7 @@ public class AdditionalPropertiesNumber implements Parcelable {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("class AdditionalPropertiesNumber {\n");
|
sb.append("class AdditionalPropertiesNumber {\n");
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||||
|
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
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()));
|
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();
|
JsonObject jsonObj = jsonElement.getAsJsonObject();
|
||||||
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
|
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()));
|
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
|
@Override
|
||||||
public void write(JsonWriter out, AdditionalPropertiesNumber value) throws IOException {
|
public void write(JsonWriter out, AdditionalPropertiesNumber value) throws IOException {
|
||||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
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);
|
elementAdapter.write(out, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,7 +258,28 @@ public class AdditionalPropertiesNumber implements Parcelable {
|
|||||||
public AdditionalPropertiesNumber read(JsonReader in) throws IOException {
|
public AdditionalPropertiesNumber read(JsonReader in) throws IOException {
|
||||||
JsonElement jsonElement = elementAdapter.read(in);
|
JsonElement jsonElement = elementAdapter.read(in);
|
||||||
validateJsonElement(jsonElement);
|
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();
|
}.nullSafe();
|
||||||
|
@ -82,6 +82,50 @@ public class AdditionalPropertiesObject implements Parcelable {
|
|||||||
this.name = name;
|
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
|
@Override
|
||||||
@ -93,12 +137,13 @@ public class AdditionalPropertiesObject implements Parcelable {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o;
|
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
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(name);
|
return Objects.hash(name, additionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -106,6 +151,7 @@ public class AdditionalPropertiesObject implements Parcelable {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("class AdditionalPropertiesObject {\n");
|
sb.append("class AdditionalPropertiesObject {\n");
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||||
|
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
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()));
|
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();
|
JsonObject jsonObj = jsonElement.getAsJsonObject();
|
||||||
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
|
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()));
|
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
|
@Override
|
||||||
public void write(JsonWriter out, AdditionalPropertiesObject value) throws IOException {
|
public void write(JsonWriter out, AdditionalPropertiesObject value) throws IOException {
|
||||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
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);
|
elementAdapter.write(out, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,7 +258,28 @@ public class AdditionalPropertiesObject implements Parcelable {
|
|||||||
public AdditionalPropertiesObject read(JsonReader in) throws IOException {
|
public AdditionalPropertiesObject read(JsonReader in) throws IOException {
|
||||||
JsonElement jsonElement = elementAdapter.read(in);
|
JsonElement jsonElement = elementAdapter.read(in);
|
||||||
validateJsonElement(jsonElement);
|
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();
|
}.nullSafe();
|
||||||
|
@ -81,6 +81,50 @@ public class AdditionalPropertiesString implements Parcelable {
|
|||||||
this.name = name;
|
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
|
@Override
|
||||||
@ -92,12 +136,13 @@ public class AdditionalPropertiesString implements Parcelable {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o;
|
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
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(name);
|
return Objects.hash(name, additionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -105,6 +150,7 @@ public class AdditionalPropertiesString implements Parcelable {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("class AdditionalPropertiesString {\n");
|
sb.append("class AdditionalPropertiesString {\n");
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||||
|
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
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()));
|
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();
|
JsonObject jsonObj = jsonElement.getAsJsonObject();
|
||||||
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) {
|
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()));
|
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
|
@Override
|
||||||
public void write(JsonWriter out, AdditionalPropertiesString value) throws IOException {
|
public void write(JsonWriter out, AdditionalPropertiesString value) throws IOException {
|
||||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
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);
|
elementAdapter.write(out, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,7 +257,28 @@ public class AdditionalPropertiesString implements Parcelable {
|
|||||||
public AdditionalPropertiesString read(JsonReader in) throws IOException {
|
public AdditionalPropertiesString read(JsonReader in) throws IOException {
|
||||||
JsonElement jsonElement = elementAdapter.read(in);
|
JsonElement jsonElement = elementAdapter.read(in);
|
||||||
validateJsonElement(jsonElement);
|
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();
|
}.nullSafe();
|
||||||
|
@ -169,6 +169,50 @@ public class Drawing {
|
|||||||
this.shapes = shapes;
|
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
|
@Override
|
||||||
@ -183,7 +227,8 @@ public class Drawing {
|
|||||||
return Objects.equals(this.mainShape, drawing.mainShape) &&
|
return Objects.equals(this.mainShape, drawing.mainShape) &&
|
||||||
Objects.equals(this.shapeOrNull, drawing.shapeOrNull) &&
|
Objects.equals(this.shapeOrNull, drawing.shapeOrNull) &&
|
||||||
Objects.equals(this.nullableShape, drawing.nullableShape) &&
|
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) {
|
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
|
||||||
@ -192,7 +237,7 @@ public class Drawing {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
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) {
|
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(" shapeOrNull: ").append(toIndentedString(shapeOrNull)).append("\n");
|
||||||
sb.append(" nullableShape: ").append(toIndentedString(nullableShape)).append("\n");
|
sb.append(" nullableShape: ").append(toIndentedString(nullableShape)).append("\n");
|
||||||
sb.append(" shapes: ").append(toIndentedString(shapes)).append("\n");
|
sb.append(" shapes: ").append(toIndentedString(shapes)).append("\n");
|
||||||
|
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
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()));
|
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();
|
JsonObject jsonObj = jsonElement.getAsJsonObject();
|
||||||
// validate the optional field `mainShape`
|
// validate the optional field `mainShape`
|
||||||
if (jsonObj.get("mainShape") != null && !jsonObj.get("mainShape").isJsonNull()) {
|
if (jsonObj.get("mainShape") != null && !jsonObj.get("mainShape").isJsonNull()) {
|
||||||
@ -305,6 +343,23 @@ public class Drawing {
|
|||||||
@Override
|
@Override
|
||||||
public void write(JsonWriter out, Drawing value) throws IOException {
|
public void write(JsonWriter out, Drawing value) throws IOException {
|
||||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
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);
|
elementAdapter.write(out, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,7 +367,28 @@ public class Drawing {
|
|||||||
public Drawing read(JsonReader in) throws IOException {
|
public Drawing read(JsonReader in) throws IOException {
|
||||||
JsonElement jsonElement = elementAdapter.read(in);
|
JsonElement jsonElement = elementAdapter.read(in);
|
||||||
validateJsonElement(jsonElement);
|
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();
|
}.nullSafe();
|
||||||
|
@ -410,6 +410,50 @@ public class NullableClass {
|
|||||||
this.objectItemsNullable = objectItemsNullable;
|
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
|
@Override
|
||||||
@ -432,7 +476,8 @@ public class NullableClass {
|
|||||||
Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) &&
|
Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) &&
|
||||||
Objects.equals(this.objectNullableProp, nullableClass.objectNullableProp) &&
|
Objects.equals(this.objectNullableProp, nullableClass.objectNullableProp) &&
|
||||||
Objects.equals(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) &&
|
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) {
|
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
|
||||||
@ -441,7 +486,7 @@ public class NullableClass {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
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) {
|
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(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n");
|
||||||
sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n");
|
sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n");
|
||||||
sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n");
|
sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n");
|
||||||
|
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
|
||||||
sb.append("}");
|
sb.append("}");
|
||||||
return sb.toString();
|
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()));
|
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();
|
JsonObject jsonObj = jsonElement.getAsJsonObject();
|
||||||
if ((jsonObj.get("string_prop") != null && !jsonObj.get("string_prop").isJsonNull()) && !jsonObj.get("string_prop").isJsonPrimitive()) {
|
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()));
|
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
|
@Override
|
||||||
public void write(JsonWriter out, NullableClass value) throws IOException {
|
public void write(JsonWriter out, NullableClass value) throws IOException {
|
||||||
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
|
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);
|
elementAdapter.write(out, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -566,7 +621,28 @@ public class NullableClass {
|
|||||||
public NullableClass read(JsonReader in) throws IOException {
|
public NullableClass read(JsonReader in) throws IOException {
|
||||||
JsonElement jsonElement = elementAdapter.read(in);
|
JsonElement jsonElement = elementAdapter.read(in);
|
||||||
validateJsonElement(jsonElement);
|
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();
|
}.nullSafe();
|
||||||
|
@ -89,12 +89,14 @@ function ConvertFrom-PSJsonToDrawing {
|
|||||||
$PSBoundParameters | Out-DebugParameter | Write-Debug
|
$PSBoundParameters | Out-DebugParameter | Write-Debug
|
||||||
|
|
||||||
$JsonParameters = ConvertFrom-Json -InputObject $Json
|
$JsonParameters = ConvertFrom-Json -InputObject $Json
|
||||||
|
$PSDrawingAdditionalProperties = @{}
|
||||||
|
|
||||||
# check if Json contains properties not defined in PSDrawing
|
# check if Json contains properties not defined in PSDrawing
|
||||||
$AllProperties = ("mainShape", "shapeOrNull", "nullableShape", "shapes")
|
$AllProperties = ("mainShape", "shapeOrNull", "nullableShape", "shapes")
|
||||||
foreach ($name in $JsonParameters.PsObject.Properties.Name) {
|
foreach ($name in $JsonParameters.PsObject.Properties.Name) {
|
||||||
|
# store undefined properties in additionalProperties
|
||||||
if (!($AllProperties.Contains($name))) {
|
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}
|
"shapeOrNull" = ${ShapeOrNull}
|
||||||
"nullableShape" = ${NullableShape}
|
"nullableShape" = ${NullableShape}
|
||||||
"shapes" = ${Shapes}
|
"shapes" = ${Shapes}
|
||||||
|
"AdditionalProperties" = $PSDrawingAdditionalProperties
|
||||||
}
|
}
|
||||||
|
|
||||||
return $PSO
|
return $PSO
|
||||||
|
@ -137,12 +137,14 @@ function ConvertFrom-PSJsonToNullableClass {
|
|||||||
$PSBoundParameters | Out-DebugParameter | Write-Debug
|
$PSBoundParameters | Out-DebugParameter | Write-Debug
|
||||||
|
|
||||||
$JsonParameters = ConvertFrom-Json -InputObject $Json
|
$JsonParameters = ConvertFrom-Json -InputObject $Json
|
||||||
|
$PSNullableClassAdditionalProperties = @{}
|
||||||
|
|
||||||
# check if Json contains properties not defined in PSNullableClass
|
# 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")
|
$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) {
|
foreach ($name in $JsonParameters.PsObject.Properties.Name) {
|
||||||
|
# store undefined properties in additionalProperties
|
||||||
if (!($AllProperties.Contains($name))) {
|
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_nullable_prop" = ${ObjectNullableProp}
|
||||||
"object_and_items_nullable_prop" = ${ObjectAndItemsNullableProp}
|
"object_and_items_nullable_prop" = ${ObjectAndItemsNullableProp}
|
||||||
"object_items_nullable" = ${ObjectItemsNullable}
|
"object_items_nullable" = ${ObjectItemsNullable}
|
||||||
|
"AdditionalProperties" = $PSNullableClassAdditionalProperties
|
||||||
}
|
}
|
||||||
|
|
||||||
return $PSO
|
return $PSO
|
||||||
|
@ -447,7 +447,7 @@ export interface Dog extends Animal {
|
|||||||
* @interface Drawing
|
* @interface Drawing
|
||||||
*/
|
*/
|
||||||
export interface Drawing {
|
export interface Drawing {
|
||||||
[key: string]: Fruit | any;
|
[key: string]: Fruit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -1043,7 +1043,7 @@ export interface Name {
|
|||||||
* @interface NullableClass
|
* @interface NullableClass
|
||||||
*/
|
*/
|
||||||
export interface NullableClass {
|
export interface NullableClass {
|
||||||
[key: string]: object | any;
|
[key: string]: object;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -811,7 +811,7 @@ export interface Name {
|
|||||||
* @interface NullableClass
|
* @interface NullableClass
|
||||||
*/
|
*/
|
||||||
export interface NullableClass {
|
export interface NullableClass {
|
||||||
[key: string]: object | any;
|
[key: string]: object;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -32,8 +32,11 @@ type NullableClass struct {
|
|||||||
ObjectNullableProp map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"`
|
ObjectNullableProp map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"`
|
||||||
ObjectAndItemsNullableProp map[string]map[string]interface{} `json:"object_and_items_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"`
|
ObjectItemsNullable map[string]map[string]interface{} `json:"object_items_nullable,omitempty"`
|
||||||
|
AdditionalProperties map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type _NullableClass NullableClass
|
||||||
|
|
||||||
// NewNullableClass instantiates a new NullableClass object
|
// NewNullableClass instantiates a new NullableClass object
|
||||||
// This constructor will assign default values to properties that have it defined,
|
// 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
|
// 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) {
|
if !IsNil(o.ObjectItemsNullable) {
|
||||||
toSerialize["object_items_nullable"] = o.ObjectItemsNullable
|
toSerialize["object_items_nullable"] = o.ObjectItemsNullable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for key, value := range o.AdditionalProperties {
|
||||||
|
toSerialize[key] = value
|
||||||
|
}
|
||||||
|
|
||||||
return toSerialize, nil
|
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 {
|
type NullableNullableClass struct {
|
||||||
value *NullableClass
|
value *NullableClass
|
||||||
isSet bool
|
isSet bool
|
||||||
|
@ -3,7 +3,10 @@
|
|||||||
.gitlab-ci.yml
|
.gitlab-ci.yml
|
||||||
.travis.yml
|
.travis.yml
|
||||||
README.md
|
README.md
|
||||||
|
docs/AdditionalPropertiesAnyType.md
|
||||||
docs/AdditionalPropertiesClass.md
|
docs/AdditionalPropertiesClass.md
|
||||||
|
docs/AdditionalPropertiesObject.md
|
||||||
|
docs/AdditionalPropertiesWithDescriptionOnly.md
|
||||||
docs/AllOfWithSingleRef.md
|
docs/AllOfWithSingleRef.md
|
||||||
docs/Animal.md
|
docs/Animal.md
|
||||||
docs/AnotherFakeApi.md
|
docs/AnotherFakeApi.md
|
||||||
@ -100,7 +103,10 @@ petstore_api/api_response.py
|
|||||||
petstore_api/configuration.py
|
petstore_api/configuration.py
|
||||||
petstore_api/exceptions.py
|
petstore_api/exceptions.py
|
||||||
petstore_api/models/__init__.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_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/all_of_with_single_ref.py
|
||||||
petstore_api/models/animal.py
|
petstore_api/models/animal.py
|
||||||
petstore_api/models/any_of_color.py
|
petstore_api/models/any_of_color.py
|
||||||
|
@ -132,7 +132,10 @@ Class | Method | HTTP request | Description
|
|||||||
|
|
||||||
## Documentation For Models
|
## Documentation For Models
|
||||||
|
|
||||||
|
- [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md)
|
||||||
- [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
|
- [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
|
||||||
|
- [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md)
|
||||||
|
- [AdditionalPropertiesWithDescriptionOnly](docs/AdditionalPropertiesWithDescriptionOnly.md)
|
||||||
- [AllOfWithSingleRef](docs/AllOfWithSingleRef.md)
|
- [AllOfWithSingleRef](docs/AllOfWithSingleRef.md)
|
||||||
- [Animal](docs/Animal.md)
|
- [Animal](docs/Animal.md)
|
||||||
- [AnyOfColor](docs/AnyOfColor.md)
|
- [AnyOfColor](docs/AnyOfColor.md)
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
|
@ -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)
|
||||||
|
|
||||||
|
|
@ -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)
|
||||||
|
|
||||||
|
|
@ -38,7 +38,10 @@ from petstore_api.exceptions import ApiException
|
|||||||
from petstore_api.signing import HttpSigningConfiguration
|
from petstore_api.signing import HttpSigningConfiguration
|
||||||
|
|
||||||
# import models into sdk package
|
# 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_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.all_of_with_single_ref import AllOfWithSingleRef
|
||||||
from petstore_api.models.animal import Animal
|
from petstore_api.models.animal import Animal
|
||||||
from petstore_api.models.any_of_color import AnyOfColor
|
from petstore_api.models.any_of_color import AnyOfColor
|
||||||
|
@ -14,7 +14,10 @@
|
|||||||
|
|
||||||
|
|
||||||
# import models into model package
|
# 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_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.all_of_with_single_ref import AllOfWithSingleRef
|
||||||
from petstore_api.models.animal import Animal
|
from petstore_api.models.animal import Animal
|
||||||
from petstore_api.models.any_of_color import AnyOfColor
|
from petstore_api.models.any_of_color import AnyOfColor
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -38,6 +38,7 @@ class NullableClass(BaseModel):
|
|||||||
object_nullable_prop: Optional[Dict[str, Dict[str, Any]]] = None
|
object_nullable_prop: Optional[Dict[str, Dict[str, Any]]] = None
|
||||||
object_and_items_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
|
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"]
|
__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:
|
class Config:
|
||||||
@ -62,8 +63,14 @@ class NullableClass(BaseModel):
|
|||||||
"""Returns the dictionary representation of the model using alias"""
|
"""Returns the dictionary representation of the model using alias"""
|
||||||
_dict = self.dict(by_alias=True,
|
_dict = self.dict(by_alias=True,
|
||||||
exclude={
|
exclude={
|
||||||
|
"additional_properties"
|
||||||
},
|
},
|
||||||
exclude_none=True)
|
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
|
# set to None if required_integer_prop (nullable) is None
|
||||||
# and __fields_set__ contains the field
|
# and __fields_set__ contains the field
|
||||||
if self.required_integer_prop is None and "required_integer_prop" in self.__fields_set__:
|
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_and_items_nullable_prop": obj.get("object_and_items_nullable_prop"),
|
||||||
"object_items_nullable": obj.get("object_items_nullable")
|
"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
|
return _obj
|
||||||
|
|
||||||
|
|
||||||
|
@ -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()
|
@ -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
|
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
|
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 unittest
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
@ -33,7 +33,9 @@ class TestAdditionalPropertiesClass(unittest.TestCase):
|
|||||||
include_option is a boolean, when False only required
|
include_option is a boolean, when False only required
|
||||||
params are included, when True both required and
|
params are included, when True both required and
|
||||||
optional params are included """
|
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 :
|
if include_optional :
|
||||||
return AdditionalPropertiesClass(
|
return AdditionalPropertiesClass(
|
||||||
map_property = {
|
map_property = {
|
||||||
@ -48,6 +50,7 @@ class TestAdditionalPropertiesClass(unittest.TestCase):
|
|||||||
else :
|
else :
|
||||||
return AdditionalPropertiesClass(
|
return AdditionalPropertiesClass(
|
||||||
)
|
)
|
||||||
|
"""
|
||||||
|
|
||||||
def testAdditionalPropertiesClass(self):
|
def testAdditionalPropertiesClass(self):
|
||||||
"""Test AdditionalPropertiesClass"""
|
"""Test AdditionalPropertiesClass"""
|
||||||
|
@ -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()
|
@ -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()
|
@ -3,7 +3,10 @@
|
|||||||
.gitlab-ci.yml
|
.gitlab-ci.yml
|
||||||
.travis.yml
|
.travis.yml
|
||||||
README.md
|
README.md
|
||||||
|
docs/AdditionalPropertiesAnyType.md
|
||||||
docs/AdditionalPropertiesClass.md
|
docs/AdditionalPropertiesClass.md
|
||||||
|
docs/AdditionalPropertiesObject.md
|
||||||
|
docs/AdditionalPropertiesWithDescriptionOnly.md
|
||||||
docs/AllOfWithSingleRef.md
|
docs/AllOfWithSingleRef.md
|
||||||
docs/Animal.md
|
docs/Animal.md
|
||||||
docs/AnotherFakeApi.md
|
docs/AnotherFakeApi.md
|
||||||
@ -100,7 +103,10 @@ petstore_api/api_response.py
|
|||||||
petstore_api/configuration.py
|
petstore_api/configuration.py
|
||||||
petstore_api/exceptions.py
|
petstore_api/exceptions.py
|
||||||
petstore_api/models/__init__.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_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/all_of_with_single_ref.py
|
||||||
petstore_api/models/animal.py
|
petstore_api/models/animal.py
|
||||||
petstore_api/models/any_of_color.py
|
petstore_api/models/any_of_color.py
|
||||||
|
@ -132,7 +132,10 @@ Class | Method | HTTP request | Description
|
|||||||
|
|
||||||
## Documentation For Models
|
## Documentation For Models
|
||||||
|
|
||||||
|
- [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md)
|
||||||
- [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
|
- [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
|
||||||
|
- [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md)
|
||||||
|
- [AdditionalPropertiesWithDescriptionOnly](docs/AdditionalPropertiesWithDescriptionOnly.md)
|
||||||
- [AllOfWithSingleRef](docs/AllOfWithSingleRef.md)
|
- [AllOfWithSingleRef](docs/AllOfWithSingleRef.md)
|
||||||
- [Animal](docs/Animal.md)
|
- [Animal](docs/Animal.md)
|
||||||
- [AnyOfColor](docs/AnyOfColor.md)
|
- [AnyOfColor](docs/AnyOfColor.md)
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
|
0
samples/openapi3/client/petstore/python/docs/AdditionalPropertiesClass.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/AdditionalPropertiesClass.md
Executable file → Normal 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)
|
||||||
|
|
||||||
|
|
@ -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
0
samples/openapi3/client/petstore/python/docs/Animal.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/ApiResponse.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/ApiResponse.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/ArrayOfNumberOnly.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/ArrayOfNumberOnly.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/ArrayTest.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/ArrayTest.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/Capitalization.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/Capitalization.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/Cat.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/Cat.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/Category.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/Category.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/ClassModel.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/ClassModel.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/Client.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/Client.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/DefaultApi.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/DefaultApi.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/Dog.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/Dog.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/EnumArrays.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/EnumArrays.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/EnumClass.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/EnumClass.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/EnumTest.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/EnumTest.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/FakeApi.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/FakeApi.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/File.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/File.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/FileSchemaTestClass.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/FileSchemaTestClass.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/Foo.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/Foo.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/FormatTest.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/FormatTest.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/HasOnlyReadOnly.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/HasOnlyReadOnly.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/HealthCheckResult.md
Executable file → Normal file
0
samples/openapi3/client/petstore/python/docs/HealthCheckResult.md
Executable file → Normal 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
Loading…
x
Reference in New Issue
Block a user