diff --git a/lib/src/code_generators/swagger_models_generator.dart b/lib/src/code_generators/swagger_models_generator.dart index 341d8e49..10b0ef5a 100644 --- a/lib/src/code_generators/swagger_models_generator.dart +++ b/lib/src/code_generators/swagger_models_generator.dart @@ -1495,7 +1495,7 @@ $copyWithMethod String generateToJson(SwaggerSchema schema, String validatedClassName) { final hasMapping = schema.discriminator?.mapping.isNotEmpty ?? false; if (hasMapping) { - return 'static Map _\$${validatedClassName}ToJson($validatedClassName instance) { return instance.toJson();}\n\n' + return 'static Map _\$${validatedClassName}ToJson($validatedClassName instance) { return Map();}\n\n' 'Map toJson() =>' '_\$${validatedClassName}ToJson(this)' '\t\t\t${schema.discriminator!.mapping.entries.map(