Skip to content

Commit

Permalink
Merge pull request #1 from arnac-io/fix/remove_redundant_postfix
Browse files Browse the repository at this point in the history
Remove the ‘fix’ postfix from json conversion functions
  • Loading branch information
nadav-fordefi authored Feb 4, 2024
2 parents 1733b47 + 658c001 commit 1a8ef11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/code_generators/swagger_models_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,7 @@ $copyWithMethod
final propertyName = discriminator.propertyName;
final responseVar = validatedClassName.camelCase;

return 'static $validatedClassName _\$${validatedClassName}FromJsonFix(Map<String, dynamic> json) { return $validatedClassName.fromJson(json);}\n\n'
return 'static $validatedClassName _\$${validatedClassName}FromJson(Map<String, dynamic> json) { return $validatedClassName.fromJson(json);}\n\n'
'${discriminator.mapping.entries.map((entry) => '${entry.value.getRef()}? ${entry.key == 'dynamic' ? 'dynamicField' : entry.key.camelCase};').join('\n')}'
'\n\n'
'factory $validatedClassName.fromJson(Map<String, dynamic> json) {'
Expand All @@ -1495,7 +1495,7 @@ $copyWithMethod
String generateToJson(SwaggerSchema schema, String validatedClassName) {
final hasMapping = schema.discriminator?.mapping.isNotEmpty ?? false;
if (hasMapping) {
return 'static Map<String, dynamic> _\$${validatedClassName}ToJsonFix($validatedClassName instance) { return instance.toJson();}\n\n'
return 'static Map<String, dynamic> _\$${validatedClassName}ToJson($validatedClassName instance) { return instance.toJson();}\n\n'
'Map<String, dynamic> toJson() =>'
'_\$${validatedClassName}ToJson(this)'
'\t\t\t${schema.discriminator!.mapping.entries.map(
Expand Down

0 comments on commit 1a8ef11

Please sign in to comment.