diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java index 2d2f563bf210..6288d267fd05 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java @@ -476,7 +476,7 @@ public void postProcessPattern(String pattern, Map vendorExtensi + "/pattern/modifiers convention. " + pattern + " is not valid."); } - String regex = pattern.substring(1, i).replace("'", "\'"); + String regex = pattern.substring(1, i).replace("'", "\'").replace("\"", "\"\""); List modifiers = new ArrayList(); // perl requires an explicit modifier to be culture specific and .NET is the reverse.