Skip to content

Commit 8f881a2

Browse files
committed
[julia] fix regex escape on server codegen
Fixed escaping of regex patterns on julialang server codegen.
1 parent 7881152 commit 8f881a2

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJuliaCodegen.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,14 @@ private void changeParamNames(List<CodegenParameter> paramsList, HashSet<String>
531531
}
532532
}
533533

534+
private void changeRegexEscape(List<CodegenParameter> paramsList) {
535+
for (CodegenParameter param : paramsList) {
536+
if (param.pattern != null) {
537+
param.pattern = escapeRegex(param.pattern);
538+
}
539+
}
540+
}
541+
534542
/**
535543
* Convert OAS Operation object to Codegen Operation object
536544
*
@@ -562,6 +570,13 @@ public CodegenOperation fromOperation(String path,
562570
changeParamNames(op.queryParams, reservedNames);
563571
changeParamNames(op.formParams, reservedNames);
564572

573+
changeRegexEscape(op.allParams);
574+
changeRegexEscape(op.bodyParams);
575+
changeRegexEscape(op.headerParams);
576+
changeRegexEscape(op.pathParams);
577+
changeRegexEscape(op.queryParams);
578+
changeRegexEscape(op.formParams);
579+
565580
return op;
566581
}
567582

0 commit comments

Comments
 (0)