Open YeomDongUk opened 9 months ago
Describe the bug When generating Swagger models with property names that share the same prefix, such as "orderStatus" and "orderStatusList," where the latter ends with "List," it creates duplicate function names.
To Reproduce
String? searchOrderDtoRequestOrderStatusListToJson( enums.SearchOrderDtoRequestOrderStatusList? searchOrderDtoRequestOrderStatusList) { return searchOrderDtoRequestOrderStatusList?.value; } enums.SearchOrderDtoRequestOrderStatusList searchOrderDtoRequestOrderStatusListFromJson( Object? searchOrderDtoRequestOrderStatusList, [ enums.SearchOrderDtoRequestOrderStatusList? defaultValue, ]) { return enums.SearchOrderDtoRequestOrderStatusList.values.firstWhereOrNull( (e) => e.value.toString().toLowerCase() == searchOrderDtoRequestOrderStatusList?.toString().toLowerCase()) ?? defaultValue ?? enums.SearchOrderDtoRequestOrderStatusList.swaggerGeneratedUnknown; } List<String> searchOrderDtoRequestOrderStatusListToJson( List<enums.SearchOrderDtoRequestOrderStatus>? searchOrderDtoRequestOrderStatus) { if (searchOrderDtoRequestOrderStatus == null) { return []; } return searchOrderDtoRequestOrderStatus.map((e) => e.value!).toList(); } List<enums.SearchOrderDtoRequestOrderStatus> searchOrderDtoRequestOrderStatusListFromJson( List? searchOrderDtoRequestOrderStatus, [ List<enums.SearchOrderDtoRequestOrderStatus>? defaultValue, ]) { if (searchOrderDtoRequestOrderStatus == null) { return defaultValue ?? []; } return searchOrderDtoRequestOrderStatus.map((e) => searchOrderDtoRequestOrderStatusFromJson(e.toString())).toList(); }
Expected behavior
Does not generate duplicate function names.
Swagger specification link I can't provide it because it's within the internal network.
Library version used: swagger_dart_code_generator: 2.11.11
Hi @YeomDongUk , can you provide swagger file with such issue?
Describe the bug When generating Swagger models with property names that share the same prefix, such as "orderStatus" and "orderStatusList," where the latter ends with "List," it creates duplicate function names.
To Reproduce
Expected behavior
Does not generate duplicate function names.
Swagger specification link I can't provide it because it's within the internal network.
Library version used: swagger_dart_code_generator: 2.11.11