|
|
@ -1168,21 +1168,23 @@ TypeResult resolveObject( |
|
|
|
'/// ${propertySchema.description!}', |
|
|
|
'/// ${propertySchema.description!}', |
|
|
|
], |
|
|
|
], |
|
|
|
]); |
|
|
|
]); |
|
|
|
if (_toDartName(propertyName) != propertyName || |
|
|
|
final hasDifferentName = _toDartName(propertyName) != propertyName; |
|
|
|
propertySchema.isJsonString || |
|
|
|
final isJsonString = propertySchema.isJsonString; |
|
|
|
extraJsonKeyValues != null) { |
|
|
|
final hasExtraJsonKeyValues = |
|
|
|
|
|
|
|
extraJsonKeyValues != null && extraJsonKeyValues.containsKey(propertyName); |
|
|
|
|
|
|
|
if (hasDifferentName || isJsonString || hasExtraJsonKeyValues) { |
|
|
|
b.annotations.add( |
|
|
|
b.annotations.add( |
|
|
|
refer('JsonKey').call( |
|
|
|
refer('JsonKey').call( |
|
|
|
[], |
|
|
|
[], |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (_toDartName(propertyName) != propertyName) ...{ |
|
|
|
if (hasDifferentName) ...{ |
|
|
|
'name': refer("'$propertyName'"), |
|
|
|
'name': refer("'$propertyName'"), |
|
|
|
}, |
|
|
|
}, |
|
|
|
if (propertySchema.isJsonString) ...{ |
|
|
|
if (isJsonString) ...{ |
|
|
|
'fromJson': refer('${result.name}.fromJsonString'), |
|
|
|
'fromJson': refer('${result.name}.fromJsonString'), |
|
|
|
'toJson': refer('${result.name}.toJsonString'), |
|
|
|
'toJson': refer('${result.name}.toJsonString'), |
|
|
|
}, |
|
|
|
}, |
|
|
|
if (extraJsonKeyValues != null && extraJsonKeyValues.containsKey(propertyName)) ...{ |
|
|
|
if (hasExtraJsonKeyValues) ...{ |
|
|
|
for (final key in extraJsonKeyValues[propertyName]!.keys) ...{ |
|
|
|
for (final key in extraJsonKeyValues[propertyName]!.keys) ...{ |
|
|
|
key: refer(extraJsonKeyValues[propertyName]![key]!), |
|
|
|
key: refer(extraJsonKeyValues[propertyName]![key]!), |
|
|
|
}, |
|
|
|
}, |
|
|
|