dart2-v3template._from_json.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.
{{#isArray}}
{{>_array_from_json}}
{{/isArray}}
{{#isMap}}
{{>_map_from_json}}
{{/isMap}}
{{^items}}
{{#isEnum}}
{{enumName}}Extension.fromJson(data)
{{/isEnum}}
{{#isDateTime}}
data == null ? data : DateTime.parse(data)
{{/isDateTime}}
{{#isDate}}
data == null ? DateTime.parse(data + 'T00:00:00.000Z')
{{/isDate}}
{{#isModel}}
data == null ? null : {{{complexType}}}.fromJson(data)
{{/isModel}}
{{#isPrimitiveType}}
data as {{{dataType}}}
{{/isPrimitiveType}}
{{/items}}