Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the ‘fix’ postfix from json conversion functions #1

Merged
merged 1 commit into from
Feb 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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