mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
Merge pull request #385 from etherealjoy/fix_new_keyword_collection
[aspnetcore] Fix new keyword collection
This commit is contained in:
commit
9990ddbe52
@ -58,7 +58,7 @@ public class CodegenModel {
|
||||
public Set<String> allMandatory;
|
||||
|
||||
public Set<String> imports = new TreeSet<String>();
|
||||
public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasRequired, hasOptional, isArrayModel, hasChildren;
|
||||
public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasRequired, hasOptional, isArrayModel, hasChildren, isMapModel;
|
||||
public boolean hasOnlyReadOnly = true; // true if all properties are read-only
|
||||
public ExternalDocumentation externalDocumentation;
|
||||
|
||||
|
@ -218,7 +218,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
parent.getChildren().add(cm);
|
||||
if (parent.getDiscriminator() == null) {
|
||||
parent = allModels.get(parent.parent);
|
||||
parent = allModels.get(parent.getParent());
|
||||
} else {
|
||||
parent = null;
|
||||
}
|
||||
@ -1521,6 +1521,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
if (ModelUtils.isMapSchema(schema)) {
|
||||
addAdditionPropertiesToCodeGenModel(m, schema);
|
||||
m.isMapModel = true;
|
||||
}
|
||||
addVars(m, schema.getProperties(), schema.getRequired());
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ namespace {{packageName}}.Models
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public {{#parent}} new {{/parent}}string ToJson()
|
||||
public {{#parent}}{{^isMapModel}}{{^isArrayModel}}new {{/isArrayModel}}{{/isMapModel}}{{/parent}}string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
@ -68,7 +68,7 @@ namespace {{packageName}}.Models
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (obj is null) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
return obj.GetType() == GetType() && Equals(({{classname}})obj);
|
||||
}
|
||||
@ -80,7 +80,7 @@ namespace {{packageName}}.Models
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals({{classname}} other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (other is null) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return {{#vars}}{{#isNotContainer}}
|
||||
|
@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Models
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (obj is null) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
return obj.GetType() == GetType() && Equals((ApiResponse)obj);
|
||||
}
|
||||
@ -85,7 +85,7 @@ namespace Org.OpenAPITools.Models
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ApiResponse other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (other is null) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return
|
||||
|
@ -66,7 +66,7 @@ namespace Org.OpenAPITools.Models
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (obj is null) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
return obj.GetType() == GetType() && Equals((Category)obj);
|
||||
}
|
||||
@ -78,7 +78,7 @@ namespace Org.OpenAPITools.Models
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Category other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (other is null) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return
|
||||
|
@ -122,7 +122,7 @@ namespace Org.OpenAPITools.Models
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (obj is null) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
return obj.GetType() == GetType() && Equals((Order)obj);
|
||||
}
|
||||
@ -134,7 +134,7 @@ namespace Org.OpenAPITools.Models
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Order other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (other is null) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return
|
||||
|
@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Models
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (obj is null) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
return obj.GetType() == GetType() && Equals((Pet)obj);
|
||||
}
|
||||
@ -136,7 +136,7 @@ namespace Org.OpenAPITools.Models
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Pet other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (other is null) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return
|
||||
|
@ -66,7 +66,7 @@ namespace Org.OpenAPITools.Models
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (obj is null) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
return obj.GetType() == GetType() && Equals((Tag)obj);
|
||||
}
|
||||
@ -78,7 +78,7 @@ namespace Org.OpenAPITools.Models
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Tag other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (other is null) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return
|
||||
|
@ -109,7 +109,7 @@ namespace Org.OpenAPITools.Models
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (obj is null) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
return obj.GetType() == GetType() && Equals((User)obj);
|
||||
}
|
||||
@ -121,7 +121,7 @@ namespace Org.OpenAPITools.Models
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(User other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (other is null) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user