Skip to content

Commit 8707056

Browse files
authored
Merge pull request #1100 from swagger-api/codegen-issue-9509
avoid double pattern property assignment in order to fix issue
2 parents 74daed5 + 62aad01 commit 8707056

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/io/swagger/codegen/v3/generators/util/OpenAPIUtil.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ public static void addPropertiesFromRef(OpenAPI openAPI, Schema refSchema, Codeg
2222
if (schema == null) {
2323
return;
2424
}
25-
codegenProperty.pattern = schema.getPattern();
25+
if (StringUtils.isBlank(codegenProperty.pattern)) {
26+
codegenProperty.pattern = schema.getPattern();
27+
}
2628
codegenProperty.minLength = schema.getMinLength();
2729
codegenProperty.maxLength = schema.getMaxLength();
2830
if (codegenProperty.pattern != null || codegenProperty.minLength != null || codegenProperty.maxLength != null) {

0 commit comments

Comments
 (0)