mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
Updated as requested to use isMapModel
This commit is contained in:
parent
dd4b1aff2e
commit
f45ec312ee
@ -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, isCollectionModel;
|
||||
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;
|
||||
|
||||
|
@ -1412,7 +1412,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
|
||||
if (ModelUtils.isArraySchema(schema)) {
|
||||
m.isArrayModel = true;
|
||||
m.isCollectionModel = true;
|
||||
m.arrayModelType = fromProperty(name, schema).complexType;
|
||||
addParentContainer(m, name, schema);
|
||||
} else if (schema instanceof ComposedSchema) {
|
||||
@ -1522,7 +1521,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
if (ModelUtils.isMapSchema(schema)) {
|
||||
addAdditionPropertiesToCodeGenModel(m, schema);
|
||||
m.isCollectionModel = true;
|
||||
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}}{{^isCollectionModel}}new {{/isCollectionModel}}{{/parent}}string ToJson()
|
||||
public {{#parent}}{{^isMapModel}}{{^isArrayModel}}new {{/isArrayModel}}{{/isMapModel}}{{/parent}}string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user