dart2-v3template.copy-with.mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openapi-dart-generator Show documentation
Show all versions of openapi-dart-generator Show documentation
dart2 generator from openapi 3.x spec files.
{{#isListContainer}}
{{#items}}
{{>list-copy-with}}
{{/items}}
{{^items}}
{{>list-copy-with}}
{{/items}}
{{/isListContainer}}
{{#isMapContainer}}
{{#isPrimitiveType}}
v == null ? null : {}..addAll(v)
{{/isPrimitiveType}}
{{^isPrimitiveType}}
{{#isContainer}}
function(v) {
var newVal;
final fld = v;
{{#items}}
{{#enumName}}
newVal = v == null ? null : {}..addAll(v);
{{/enumName}}
{{^enumName}}
newVal = v?.map((k, v) => MapEntry(k,{{^items}}{{>copy-with}}{{/items}}{{#items}}{{>copy-with}}{{/items}})); // e1
{{/enumName}}
{{/items}}
{{/isContainer}}
{{^isContainer}}
newVal = v?.map((k, v) => MapEntry(k, {{^items}}{{>copy-with}}{{/items}}{{#items}}{{>copy-with}}{{/items}})); // e2
{{/isContainer}}
return newVal;
}(v)
{{/isPrimitiveType}}
{{/isMapContainer}}
{{^isContainer}}
{{#isModel}}
v?.copyWith()
{{/isModel}}
{{^isModel}}
v
{{/isModel}}
{{/isContainer}}