|
|
@ -1182,8 +1182,7 @@ TypeResult resolveObject( |
|
|
|
]); |
|
|
|
]); |
|
|
|
final hasDifferentName = _toDartName(propertyName) != propertyName; |
|
|
|
final hasDifferentName = _toDartName(propertyName) != propertyName; |
|
|
|
final isContentString = propertySchema.isContentString; |
|
|
|
final isContentString = propertySchema.isContentString; |
|
|
|
final isContentStringArray = |
|
|
|
final isContentStringArray = isContentString && result is TypeResultList; |
|
|
|
result is TypeResultList && (propertySchema.items?.isContentString ?? false); |
|
|
|
|
|
|
|
final hasExtraJsonKeyValues = |
|
|
|
final hasExtraJsonKeyValues = |
|
|
|
extraJsonKeyValues != null && extraJsonKeyValues.containsKey(propertyName); |
|
|
|
extraJsonKeyValues != null && extraJsonKeyValues.containsKey(propertyName); |
|
|
|
if (hasDifferentName || isContentString || isContentStringArray || hasExtraJsonKeyValues) { |
|
|
|
if (hasDifferentName || isContentString || isContentStringArray || hasExtraJsonKeyValues) { |
|
|
@ -1217,7 +1216,7 @@ TypeResult resolveObject( |
|
|
|
Method( |
|
|
|
Method( |
|
|
|
(final b) => b |
|
|
|
(final b) => b |
|
|
|
..name = toJson |
|
|
|
..name = toJson |
|
|
|
..returns = refer('List<String>?') |
|
|
|
..returns = refer('String?') |
|
|
|
..lambda = true |
|
|
|
..lambda = true |
|
|
|
..requiredParameters.addAll([ |
|
|
|
..requiredParameters.addAll([ |
|
|
|
Parameter( |
|
|
|
Parameter( |
|
|
@ -1227,7 +1226,7 @@ TypeResult resolveObject( |
|
|
|
), |
|
|
|
), |
|
|
|
]) |
|
|
|
]) |
|
|
|
..body = Code( |
|
|
|
..body = Code( |
|
|
|
'data == null ? null : ${result.encode(result.serialize('data'), mimeType: 'application/json', onlyChildren: true)};', |
|
|
|
'data == null ? null : ${result.encode(result.serialize('data'), mimeType: 'application/json')};', |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|