From 63307648ca91dddf8358403909d676a92cdd6324 Mon Sep 17 00:00:00 2001 From: Ravi Mantena Date: Wed, 16 Dec 2020 12:45:29 -0500 Subject: Changes to Regex for Name and version Issue-ID: DCAEGEN2-1867 Issue-ID: DCAEGEN2-1867 Change-Id: I59bcfed6efa95c44e1f66523dfc3ed6e535fefac Signed-off-by: Ravi Mantena --- .../dcaegen2/platform/mod/model/restapi/PolicyModelCreateRequest.java | 4 ++-- mod2/catalog-service/src/main/resources/application.properties | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'mod2/catalog-service') diff --git a/mod2/catalog-service/src/main/java/org/onap/dcaegen2/platform/mod/model/restapi/PolicyModelCreateRequest.java b/mod2/catalog-service/src/main/java/org/onap/dcaegen2/platform/mod/model/restapi/PolicyModelCreateRequest.java index a4258f4..db806bb 100644 --- a/mod2/catalog-service/src/main/java/org/onap/dcaegen2/platform/mod/model/restapi/PolicyModelCreateRequest.java +++ b/mod2/catalog-service/src/main/java/org/onap/dcaegen2/platform/mod/model/restapi/PolicyModelCreateRequest.java @@ -40,7 +40,7 @@ import javax.validation.constraints.Size; public class PolicyModelCreateRequest { @NotBlank - @Pattern(regexp = "^([a-z0-9](-[a-z0-9])*)+$", message = "Policy Model name is invalid. Accepts lower alphanumerics and hyphens.") + @Pattern(regexp = "^([a-zA-Z0-9]([.|-][a-zA-Z0-9])*)+$", message = "Policy Model name is invalid. Accepts alphanumerics, Dot(.) and hyphens.") @Size(min = 5, max = 50, message = "Policy Model name length cannot exceed 50 characters") private String name; @@ -51,7 +51,7 @@ public class PolicyModelCreateRequest { private String owner; @NotBlank - @Pattern(regexp = "[0-9].[0-9].[0-9]", message = "Policy Model version is invalid. Should be in x.x.x format.") + @Pattern(regexp = "[0-9][.][0-9][.][0-9]", message = "Policy Model version is invalid. Should be in x.x.x format.") private String version; private MetadataRequest metadata; diff --git a/mod2/catalog-service/src/main/resources/application.properties b/mod2/catalog-service/src/main/resources/application.properties index f818c6c..93c7883 100644 --- a/mod2/catalog-service/src/main/resources/application.properties +++ b/mod2/catalog-service/src/main/resources/application.properties @@ -30,7 +30,7 @@ spring.data.mongodb.database=dcae_mod url.path=/policy/api/v1/policytypes dev.server=10.12.6.2 -dev.port=31317 +dev.port=30522 dev.user=healthcheck dev.password=PASSWORD_GOES_HERE -- cgit 1.2.3-korg