forked from loafle/openapi-generator-original
* Update samples Co-authored-by: 0xNF <0xNF>
This commit is contained in:
@@ -171,7 +171,12 @@ class {{{classname}}} {
|
||||
{{/items.complexType}}
|
||||
{{/items.isMap}}
|
||||
{{^items.isMap}}
|
||||
{{{name}}}: mapValueOfType<{{{datatypeWithEnum}}}>(json, r'{{{baseName}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}},
|
||||
{{#items.complexType}}
|
||||
{{{name}}}: {{{items.complexType}}}.mapFromJson(json[r'{{{baseName}}}'{{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}}]) ?? {{{.}}}{{/defaultValue}}{{/required}},
|
||||
{{/items.complexType}}
|
||||
{{^items.complexType}}
|
||||
{{{name}}}: mapCastOfType<String, {{items.dataType}}>(json, r'{{{baseName}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}},
|
||||
{{/items.complexType}}
|
||||
{{/items.isMap}}
|
||||
{{/items.isArray}}
|
||||
{{/isMap}}
|
||||
|
||||
@@ -85,7 +85,7 @@ class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
return MixedPropertiesAndAdditionalPropertiesClass(
|
||||
uuid: mapValueOfType<String>(json, r'uuid'),
|
||||
dateTime: mapDateTime(json, r'dateTime', ''),
|
||||
map: mapValueOfType<Map<String, Animal>>(json, r'map') ?? const {},
|
||||
map: Animal.mapFromJson(json[r'map']) ?? const {},
|
||||
);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -152,9 +152,9 @@ class NullableClass {
|
||||
arrayNullableProp: Object.listFromJson(json[r'array_nullable_prop']) ?? const [],
|
||||
arrayAndItemsNullableProp: Object.listFromJson(json[r'array_and_items_nullable_prop']) ?? const [],
|
||||
arrayItemsNullable: Object.listFromJson(json[r'array_items_nullable']) ?? const [],
|
||||
objectNullableProp: mapValueOfType<Map<String, Object>>(json, r'object_nullable_prop') ?? const {},
|
||||
objectAndItemsNullableProp: mapValueOfType<Map<String, Object>>(json, r'object_and_items_nullable_prop') ?? const {},
|
||||
objectItemsNullable: mapValueOfType<Map<String, Object>>(json, r'object_items_nullable') ?? const {},
|
||||
objectNullableProp: mapCastOfType<String, Object>(json, r'object_nullable_prop') ?? const {},
|
||||
objectAndItemsNullableProp: mapCastOfType<String, Object>(json, r'object_and_items_nullable_prop') ?? const {},
|
||||
objectItemsNullable: mapCastOfType<String, Object>(json, r'object_items_nullable') ?? const {},
|
||||
);
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user