dart2-v3template._simple_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.
{{#isEnum}}
{{enumName}}Extension.fromJson(json[r'{{{baseName}}}'])
{{/isEnum}}
{{#isDateTime}}
DateTime.parse(json[r'{{{baseName}}}'])
{{/isDateTime}}
{{#isDate}}
DateTime.parse(json[r'{{{baseName}}}'] + 'T00:00:00.000Z')
{{/isDate}}
{{#isModel}}
{{{complexType}}}.fromJson(json[r'{{{baseName}}}'])
{{/isModel}}
{{#isPrimitiveType}}
(json[r'{{{baseName}}}'] as {{{dataType}}})
{{/isPrimitiveType}}