From 892fd1444cf33036fe848fef9e28d511f131ce66 Mon Sep 17 00:00:00 2001 From: Uladzimir_Paliukhovich Date: Fri, 29 Dec 2023 13:46:31 +0300 Subject: [PATCH] Development (#701) * Fixed some issues * formatted code * updated SDK * Updated SDK and version * Fixed generation of lists of classes * Fixed generation $Items classes * Updated pubspec and changelog * Fixed #524 * Fixed #598 Generation of query enum parameters * Fixed conflicts * Fixed some issues in swaggers * Updated changelog and pubspec * Fix #583, #637, #619 and update readme (#638) * fix #583 and update readme * fix #637 * fix #619 * Fixed generation of some fields * Removed test * Fixed classes named List * Fixed generation of query parameters with ref default type * Fixed generation of DateTime parameters * Fixed generation of responses in some cases * Some fixes * Updated changelog and pubspec * Implemented not nullable fields * Fixed tests * fixed generation of some swaggers * Added ability to return String values * Returned main.dart content * Updated pubspec and changelog * Fixed generation of required and not required fields * Added check for object ref in body * Fixed some things * Fixed tests * Fixed tests * Fixed some things * Updated changelog and pubspec * Removed not needed lines in tests * Fixed generation of nullable responses * Added generation of DateTime * Updated pubspec and changelog * Fixed tests * Fixed #669 Generation models from content schema allof * Fixed #665 generation putIfAbsent for response from content schema * Fixed generation of nullable and required properties * Fixed tests * Fixed some stuff related to nullable properties * Updated changelog and pubspec * Formatted code * Formatted code * Fixed tests * Fixed generation of some enums inside classes * Implemented support of exploded parameters * Pushed constants file * Fixed generation of allOf for request bodies * Implemented overriden_models functionality * Improved overriden models logic * Fixed tests * Updated pubspec and changelog * Removed support of exploded parameters * Fixed generation of patameters contains keywords * Updated pubspec and changelog * Fixed generation of nullable and not nullable fields * Fixed generation of list parameters with specific names * Fixed formurlencoded requests * Revert "Fixed formurlencoded requests" This reverts commit d103118975e7f66ec2cbf10a1f9d28ef935be6eb. * Updated changelog and pubspec * formatted code * Fixed version in changelog * Added generation of writeOnly and readOnly fields as nullable and no required (Issue 487) * Fixed generatino of DateTime query parameters (Issue 536) * Updated pubspec and changelog * Fixed generation in some cases * Added ability to rename downloaded files * Updated example * Implemented support of deprecated fields annotations * Added support of deprecated requests annotations * Fixed tests, updated pubspec and changelog * Fixed putIfAbsent for allOf schemas #700 * Fixed tests --------- Co-authored-by: Uladzimir Paliukhovich Co-authored-by: Romain --- CHANGELOG.md | 2 + lib/src/code_generators/constants.dart | 1 + .../swagger_models_generator.dart | 171 ++++++++++-------- .../swagger_requests_generator.dart | 34 +++- .../requests/swagger_request.dart | 4 + .../requests/swagger_request.g2.dart | 2 + .../responses/swagger_schema.dart | 4 + .../responses/swagger_schema.g2.dart | 2 + pubspec.yaml | 2 +- .../models_generator_test.dart | 117 ++++++------ 10 files changed, 203 insertions(+), 136 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e5f0678..0e954bcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ * ***Breaking*** Added ability to rename downloaded swagger files ([#558](https://github.com/epam-cross-platform-lab/swagger-dart-code-generator/issues/558)) +* Added support of deprecated fields and methods ([#699](https://github.com/epam-cross-platform-lab/swagger-dart-code-generator/issues/699)) + # 2.13.5 * Added `ErrorConverter` to create method diff --git a/lib/src/code_generators/constants.dart b/lib/src/code_generators/constants.dart index 6852a51e..473eea5b 100644 --- a/lib/src/code_generators/constants.dart +++ b/lib/src/code_generators/constants.dart @@ -60,6 +60,7 @@ const kFormData = 'formData'; const kMultipart = 'multipart'; const kDateTimeFormat = 'date-time'; const kFactoryConverter = 'factoryConverter'; +const kDeprecatedAnnotation = '@deprecated'; const kDefaultBodyParameter = 'Object'; const kField = 'Field'; diff --git a/lib/src/code_generators/swagger_models_generator.dart b/lib/src/code_generators/swagger_models_generator.dart index 6dce5ec8..25be4f2b 100644 --- a/lib/src/code_generators/swagger_models_generator.dart +++ b/lib/src/code_generators/swagger_models_generator.dart @@ -437,13 +437,14 @@ abstract class SwaggerModelsGenerator extends SwaggerGeneratorBase { return ', includeIfNull: ${options.includeIfNull}'; } - String generatePropertyContentByDefault( - SwaggerSchema prop, - String propertyName, - List allEnumNames, - List allEnumListNames, - List requiredProperties, - ) { + String generatePropertyContentByDefault({ + required SwaggerSchema prop, + required String propertyName, + required List allEnumNames, + required List allEnumListNames, + required List requiredProperties, + required bool isDeprecated, + }) { var typeName = ''; if (prop.hasOriginalRef) { @@ -487,8 +488,9 @@ abstract class SwaggerModelsGenerator extends SwaggerGeneratorBase { final jsonKeyContent = "@JsonKey(name: '$propertyKey'$includeIfNullString$dateToJsonValue${unknownEnumValue.jsonKey})\n"; + final deprecatedContent = isDeprecated ? '@deprecated\n' : ''; - return '\t$jsonKeyContent\tfinal $typeName ${generateFieldName(propertyName)};${unknownEnumValue.fromJson}'; + return '\t$jsonKeyContent$deprecatedContent\tfinal $typeName ${generateFieldName(propertyName)};${unknownEnumValue.fromJson}'; } JsonEnumValue generateEnumValue({ @@ -666,6 +668,8 @@ static $returnType $fromJsonFunction($valueType? value) => $enumNameCamelCase$fr final jsonKeyContent = "@JsonKey(name: '${_validatePropertyKey(propertyKey)}'$includeIfNullString${unknownEnumValue.jsonKey}$dateToJsonValue)\n"; + final deprecatedContent = + propertySchema.deprecated ? kDeprecatedAnnotation : ''; if (prop.shouldBeNullable || (options.nullableModels.contains(className) && @@ -673,7 +677,7 @@ static $returnType $fromJsonFunction($valueType? value) => $enumNameCamelCase$fr typeName = typeName.makeNullable(); } - return '\t$jsonKeyContent\tfinal $typeName ${generateFieldName(propertyName)};${unknownEnumValue.fromJson}'; + return '\t$jsonKeyContent$deprecatedContent\tfinal $typeName ${generateFieldName(propertyName)};${unknownEnumValue.fromJson}'; } String _validatePropertyKey(String key) { @@ -734,13 +738,15 @@ static $returnType $fromJsonFunction($valueType? value) => $enumNameCamelCase$fr final jsonKeyContent = "@JsonKey(name: '${_validatePropertyKey(propertyKey)}'$includeIfNullString${unknownEnumValue.jsonKey})\n"; + final deprecatedContent = prop.deprecated ? kDeprecatedAnnotation : ''; + if (prop.shouldBeNullable || options.nullableModels.contains(className) || !requiredProperties.contains(propertyKey)) { typeName = typeName.makeNullable(); } - return '\t$jsonKeyContent\tfinal $typeName $propertyName;${unknownEnumValue.fromJson}'; + return '\t$jsonKeyContent$deprecatedContent\tfinal $typeName $propertyName;${unknownEnumValue.fromJson}'; } String generatePropertyContentByRef( @@ -806,6 +812,9 @@ static $returnType $fromJsonFunction($valueType? value) => $enumNameCamelCase$fr final jsonKeyContent = "@JsonKey(name: '${_validatePropertyKey(propertyKey)}'$includeIfNullString${unknownEnumValue.jsonKey})\n"; + final deprecatedContent = + refSchema?.deprecated == true ? kDeprecatedAnnotation : ''; + if (prop.shouldBeNullable || options.nullableModels.contains(className) || !requiredProperties.contains(propertyKey)) { @@ -826,18 +835,19 @@ static $returnType $fromJsonFunction($valueType? value) => $enumNameCamelCase$fr typeName += '?'; } - return '\t$jsonKeyContent\tfinal $typeName $propertyName;${unknownEnumValue.fromJson}'; + return '\t$jsonKeyContent$deprecatedContent\tfinal $typeName $propertyName;${unknownEnumValue.fromJson}'; } - String generateEnumPropertyContent( - String key, - String className, - String propertyKey, - List allEnumNames, - List allEnumListNames, - SwaggerSchema prop, - List requiredProperties, - ) { + String generateEnumPropertyContent({ + required String key, + required String className, + required String propertyKey, + required List allEnumNames, + required List allEnumListNames, + required SwaggerSchema prop, + required List requiredProperties, + required bool isDeprecated, + }) { final enumName = getValidatedClassName(generateEnumName(className, key)); allEnumNames.add(enumName); @@ -863,6 +873,7 @@ static $returnType $fromJsonFunction($valueType? value) => $enumNameCamelCase$fr return ''' @JsonKey(${unknownEnumValue.jsonKey.substring(2)}$includeIfNullString) + ${isDeprecated ? kDeprecatedAnnotation : ''} final $enumPropertyName ${generateFieldName(key)}; ${unknownEnumValue.fromJson}'''; @@ -953,18 +964,19 @@ static $returnType $fromJsonFunction($valueType? value) => $enumNameCamelCase$fr return typeName; } - String generateListPropertyContent( - String propertyName, - String propertyKey, - String className, - SwaggerSchema prop, - List classesWithNullableLists, - List allEnumNames, - List allEnumListNames, - Map basicTypesMap, - List requiredProperties, - Map allClasses, - ) { + String generateListPropertyContent({ + required String propertyName, + required String propertyKey, + required String className, + required SwaggerSchema prop, + required List classesWithNullableLists, + required List allEnumNames, + required List allEnumListNames, + required Map basicTypesMap, + required List requiredProperties, + required Map allClasses, + required bool isDeprecated, + }) { final typeName = _generateListPropertyTypeName( allEnumListNames: allEnumListNames, allEnumNames: allEnumNames, @@ -1004,6 +1016,8 @@ static $returnType $fromJsonFunction($valueType? value) => $enumNameCamelCase$fr "@JsonKey(name: '$validatedPropertyKey'$includeIfNullString${unknownEnumValue.jsonKey})\n"; } + final deprecatedContent = isDeprecated ? kDeprecatedAnnotation : ''; + var listPropertyName = 'List<$typeName>'; if (prop.shouldBeNullable || @@ -1012,24 +1026,27 @@ static $returnType $fromJsonFunction($valueType? value) => $enumNameCamelCase$fr listPropertyName = listPropertyName.makeNullable(); } - return '$jsonKeyContent final $listPropertyName ${generateFieldName(propertyName)};${unknownEnumValue.fromJson}'; + return '$jsonKeyContent$deprecatedContent final $listPropertyName ${generateFieldName(propertyName)};${unknownEnumValue.fromJson}'; } - String generateGeneralPropertyContent( - String propertyName, - String propertyKey, - String className, - List defaultValues, - SwaggerSchema prop, - List allEnumNames, - List allEnumListNames, - List requiredProperties, - ) { + String generateGeneralPropertyContent({ + required String propertyName, + required String propertyKey, + required String className, + required List defaultValues, + required SwaggerSchema prop, + required List allEnumNames, + required List allEnumListNames, + required List requiredProperties, + required bool isDeprecated, + }) { final includeIfNullString = generateIncludeIfNullString(); var jsonKeyContent = "@JsonKey(name: '${_validatePropertyKey(propertyKey)}'$includeIfNullString"; + final isDeprecatedContent = isDeprecated ? kDeprecatedAnnotation : ''; + var typeName = ''; if (prop.hasAdditionalProperties && prop.type == 'object') { @@ -1085,7 +1102,7 @@ static $returnType $fromJsonFunction($valueType? value) => $enumNameCamelCase$fr typeName = typeName.makeNullable(); } - return '\t$jsonKeyContent final $typeName $propertyName;${unknownEnumValue.fromJson}'; + return '\t$jsonKeyContent$isDeprecatedContent final $typeName $propertyName;${unknownEnumValue.fromJson}'; } String generatePropertyContentByType( @@ -1100,41 +1117,45 @@ static $returnType $fromJsonFunction($valueType? value) => $enumNameCamelCase$fr Map basicTypesMap, List requiredProperties, Map allClasses, + bool isDeprecated, ) { switch (prop.type) { case 'array': return generateListPropertyContent( - propertyName, - propertyKey, - className, - prop, - classesWithNullableLists, - allEnumsNames, - allEnumListNames, - basicTypesMap, - requiredProperties, - allClasses, + propertyName: propertyName, + propertyKey: propertyKey, + className: className, + prop: prop, + classesWithNullableLists: classesWithNullableLists, + allEnumNames: allEnumsNames, + allEnumListNames: allEnumListNames, + basicTypesMap: basicTypesMap, + requiredProperties: requiredProperties, + allClasses: allClasses, + isDeprecated: isDeprecated, ); case 'enum': return generateEnumPropertyContent( - propertyName, - className, - propertyKey, - allEnumsNames, - allEnumListNames, - prop, - requiredProperties, + key: propertyName, + className: className, + propertyKey: propertyKey, + allEnumNames: allEnumsNames, + allEnumListNames: allEnumListNames, + prop: prop, + requiredProperties: requiredProperties, + isDeprecated: isDeprecated, ); default: return generateGeneralPropertyContent( - propertyName, - propertyKey, - className, - defaultValues, - prop, - allEnumsNames, - allEnumListNames, - requiredProperties, + propertyName: propertyName, + propertyKey: propertyKey, + className: className, + defaultValues: defaultValues, + prop: prop, + allEnumNames: allEnumsNames, + allEnumListNames: allEnumListNames, + requiredProperties: requiredProperties, + isDeprecated: isDeprecated, ); } } @@ -1198,6 +1219,7 @@ static $returnType $fromJsonFunction($valueType? value) => $enumNameCamelCase$fr basicTypesMap, requiredProperties, allClasses, + prop.deprecated, )); } else if (prop.allOf.isNotEmpty) { results.add( @@ -1237,11 +1259,12 @@ static $returnType $fromJsonFunction($valueType? value) => $enumNameCamelCase$fr )); } else { results.add(generatePropertyContentByDefault( - prop, - propertyName, - allEnumNames, - allEnumListNames, - requiredProperties, + prop: prop, + propertyName: propertyName, + allEnumNames: allEnumNames, + allEnumListNames: allEnumListNames, + requiredProperties: requiredProperties, + isDeprecated: prop.deprecated, )); } } diff --git a/lib/src/code_generators/swagger_requests_generator.dart b/lib/src/code_generators/swagger_requests_generator.dart index a9637d5d..10101d58 100644 --- a/lib/src/code_generators/swagger_requests_generator.dart +++ b/lib/src/code_generators/swagger_requests_generator.dart @@ -216,8 +216,14 @@ class SwaggerRequestsGenerator extends SwaggerGeneratorBase { componentsParameters: swaggerRoot.components?.parameters ?? {}, )) ..name = methodName - ..annotations.addAll(_getMethodAnnotation(requestType, annotationPath, - hasOptionalBody, isMultipart, isUrlencoded)) + ..annotations.addAll(_getMethodAnnotation( + requestType: requestType, + path: annotationPath, + hasOptionalBody: hasOptionalBody, + isMultipart: isMultipart, + isUrlencoded: isUrlencoded, + isDeprecated: swaggerRequest.deprecated, + )) ..returns = Reference(returns)); final allModels = _getAllMethodModels( @@ -227,7 +233,11 @@ class SwaggerRequestsGenerator extends SwaggerGeneratorBase { ); final privateMethod = _getPrivateMethod(method); - final publicMethod = _getPublicMethod(method, allModels); + final publicMethod = _getPublicMethod( + method, + allModels, + swaggerRequest.deprecated, + ); methods.addAll([publicMethod, privateMethod]); }); }); @@ -352,6 +362,9 @@ class SwaggerRequestsGenerator extends SwaggerGeneratorBase { } else if (successResponse?.content?.schema?.properties.isNotEmpty == true) { results.add(response); + } else if (successResponse?.content?.schema?.allOf.isNotEmpty == true && + successResponse?.content?.schema?.title.isNotEmpty == true) { + results.add(response); } return results.where((element) => _isValidModelName(element)).toList(); @@ -412,7 +425,8 @@ class SwaggerRequestsGenerator extends SwaggerGeneratorBase { ); } - Method _getPublicMethod(Method method, List allModels) { + Method _getPublicMethod( + Method method, List allModels, bool isDeprecated) { final parameters = method.optionalParameters.map((p) => p.copyWith(annotations: [])); @@ -422,6 +436,7 @@ class SwaggerRequestsGenerator extends SwaggerGeneratorBase { ..docs.addAll(method.docs) ..name = method.name ..returns = method.returns + ..annotations.addAll([if (isDeprecated) refer('deprecated')]) ..body = _generatePublicMethodCode( method.optionalParameters, method.name!, @@ -472,9 +487,16 @@ class SwaggerRequestsGenerator extends SwaggerGeneratorBase { '$allModelsString\nreturn _$publicMethodName($parametersListString);'); } - List _getMethodAnnotation(String requestType, String path, - bool hasOptionalBody, bool isMultipart, bool isUrlencoded) { + List _getMethodAnnotation({ + required String requestType, + required String path, + required bool hasOptionalBody, + required bool isMultipart, + required bool isUrlencoded, + required bool isDeprecated, + }) { return [ + if (isDeprecated) refer('deprecated'), refer(requestType.pascalCase).call( [], { diff --git a/lib/src/swagger_models/requests/swagger_request.dart b/lib/src/swagger_models/requests/swagger_request.dart index df8a66a4..259c7967 100644 --- a/lib/src/swagger_models/requests/swagger_request.dart +++ b/lib/src/swagger_models/requests/swagger_request.dart @@ -18,6 +18,7 @@ class SwaggerRequest { this.produces = const [], this.security = const [], this.requestBody, + this.deprecated = false, }); @JsonKey(name: 'summary', defaultValue: '') @@ -26,6 +27,9 @@ class SwaggerRequest { @JsonKey(name: 'description', defaultValue: '') String description; + @JsonKey(name: 'deprecated', defaultValue: false) + bool deprecated; + @JsonKey(name: 'operationId', defaultValue: '') String operationId; diff --git a/lib/src/swagger_models/requests/swagger_request.g2.dart b/lib/src/swagger_models/requests/swagger_request.g2.dart index 22955754..83fff390 100644 --- a/lib/src/swagger_models/requests/swagger_request.g2.dart +++ b/lib/src/swagger_models/requests/swagger_request.g2.dart @@ -11,6 +11,7 @@ SwaggerRequest _$SwaggerRequestFromJson(Map json) => summary: json['summary'] as String? ?? '', description: json['description'] as String? ?? '', operationId: json['operationId'] as String? ?? '', + deprecated: json['deprecated'] as bool? ?? false, consumes: (json['consumes'] as List?) ?.map((e) => e as String) .toList() ?? @@ -42,6 +43,7 @@ Map _$SwaggerRequestToJson(SwaggerRequest instance) => 'summary': instance.summary, 'description': instance.description, 'operationId': instance.operationId, + 'deprecated': instance.deprecated, 'consumes': instance.consumes, 'produces': instance.produces, 'responses': instance.responses, diff --git a/lib/src/swagger_models/responses/swagger_schema.dart b/lib/src/swagger_models/responses/swagger_schema.dart index 5f91fb72..09ecb64c 100644 --- a/lib/src/swagger_models/responses/swagger_schema.dart +++ b/lib/src/swagger_models/responses/swagger_schema.dart @@ -27,6 +27,7 @@ class SwaggerSchema { this.title = '', this.readOnly = false, this.writeOnly = false, + this.deprecated = false, }); @JsonKey(name: 'readOnly', defaultValue: false) @@ -38,6 +39,9 @@ class SwaggerSchema { @JsonKey(name: 'type', defaultValue: '') String type; + @JsonKey(name: 'deprecated', defaultValue: false) + bool deprecated; + @JsonKey(name: 'title', defaultValue: '') String title; diff --git a/lib/src/swagger_models/responses/swagger_schema.g2.dart b/lib/src/swagger_models/responses/swagger_schema.g2.dart index deb0075f..2d9c735b 100644 --- a/lib/src/swagger_models/responses/swagger_schema.g2.dart +++ b/lib/src/swagger_models/responses/swagger_schema.g2.dart @@ -44,6 +44,7 @@ SwaggerSchema _$SwaggerSchemaFromJson(Map json) => title: json['title'] as String? ?? '', readOnly: json['readOnly'] as bool? ?? false, writeOnly: json['writeOnly'] as bool? ?? false, + deprecated: json['deprecated'] as bool? ?? false, enumNames: (json['enumNames'] as List?) ?.map((e) => e as String) .toList(), @@ -77,6 +78,7 @@ Map _$SwaggerSchemaToJson(SwaggerSchema instance) => 'title': instance.title, 'readOnly': instance.readOnly, 'writeOnly': instance.writeOnly, + 'deprecated': instance.deprecated, 'additionalProperties': instance.hasAdditionalProperties, 'enumNames': instance.enumNames, }; diff --git a/pubspec.yaml b/pubspec.yaml index 3063e3ac..a6d39907 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: swagger_dart_code_generator -version: 2.13.5 +version: 2.14.1 homepage: https://github.com/epam-cross-platform-lab/swagger-dart-code-generator repository: https://github.com/epam-cross-platform-lab/swagger-dart-code-generator diff --git a/test/generator_tests/models_generator_test.dart b/test/generator_tests/models_generator_test.dart index c93d4190..7663d7c6 100644 --- a/test/generator_tests/models_generator_test.dart +++ b/test/generator_tests/models_generator_test.dart @@ -161,11 +161,12 @@ void main() { const propertyName = 'shipDate'; const jsonKeyExpendedResult = "@JsonKey(name: '$propertyName'"; final result = generator.generatePropertyContentByDefault( - propertyEntryMap, - propertyName, - [], - [], - [], + prop: propertyEntryMap, + propertyName: propertyName, + allEnumNames: [], + allEnumListNames: [], + requiredProperties: [], + isDeprecated: false, ); expect(result, contains(jsonKeyExpendedResult)); @@ -179,11 +180,12 @@ void main() { outputFolder: '', includeIfNull: false, )).generatePropertyContentByDefault( - propertyEntryMap, - propertyName, - [], - [], - [], + prop: propertyEntryMap, + propertyName: propertyName, + allEnumNames: [], + allEnumListNames: [], + requiredProperties: [], + isDeprecated: false, ); expect(result, contains(', includeIfNull: false')); @@ -193,11 +195,12 @@ void main() { final propertyEntryMap = SwaggerSchema(originalRef: 'Pet'); const propertyName = 'shipDate'; final result = generator.generatePropertyContentByDefault( - propertyEntryMap, - propertyName, - [], - [], - [], + prop: propertyEntryMap, + propertyName: propertyName, + allEnumNames: [], + allEnumListNames: [], + requiredProperties: [], + isDeprecated: false, ); expect(result.contains(', includeIfNull: false'), equals(false)); @@ -422,16 +425,17 @@ void main() { const propertyExpectedResult = 'final List? dog'; final result = generator.generateListPropertyContent( - propertyName, - propertyKey, - className, - map, - [], - [], - [], - {}, - [], - {}, + propertyName: propertyName, + propertyKey: propertyKey, + className: className, + prop: map, + classesWithNullableLists: [], + allEnumNames: [], + allEnumListNames: [], + basicTypesMap: {}, + requiredProperties: [], + allClasses: {}, + isDeprecated: false, ); expect(result, contains(jsonKeyExpectedResult)); @@ -444,16 +448,17 @@ void main() { const className = 'Animals'; const propertyKey = 'Dog'; final result = generator.generateListPropertyContent( - propertyName, - propertyKey, - className, - map, - [], - ['Dog'], - [], - {}, - [], - {}, + propertyName: propertyName, + propertyKey: propertyKey, + className: className, + prop: map, + classesWithNullableLists: [], + allEnumNames: ['Dog'], + allEnumListNames: [], + basicTypesMap: {}, + requiredProperties: [], + allClasses: {}, + isDeprecated: false, ); expect( @@ -468,16 +473,17 @@ void main() { const propertyKey = 'Dog'; final result = generator.generateListPropertyContent( - propertyName, - propertyKey, - className, - map, - [], - [], - [], - {}, - [], - {}, + propertyName: propertyName, + propertyKey: propertyKey, + className: className, + prop: map, + classesWithNullableLists: [], + allEnumNames: [], + allEnumListNames: [], + basicTypesMap: {}, + requiredProperties: [], + allClasses: {}, + isDeprecated: false, ); expect(result, contains('final List? dog;')); @@ -491,16 +497,17 @@ void main() { const propertyKey = 'Dog'; final result = generator.generateListPropertyContent( - propertyName, - propertyKey, - className, - map, - [], - [], - [], - {}, - [], - {}, + propertyName: propertyName, + propertyKey: propertyKey, + className: className, + prop: map, + classesWithNullableLists: [], + allEnumNames: [], + allEnumListNames: [], + basicTypesMap: {}, + requiredProperties: [], + allClasses: {}, + isDeprecated: false, ); expect(result, contains('final List? dog;'));