Skip to content

Commit d71d695

Browse files
author
Rob Tjalma
authored
Merge pull request #54 from com-pas/filename-validator
Use Filename Validator from core.
2 parents 14db6da + 0d71753 commit d71d695

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/model/CreateRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
package org.lfenergy.compas.scl.data.rest.v1.model;
66

77
import org.eclipse.microprofile.openapi.annotations.media.Schema;
8+
import org.lfenergy.compas.core.commons.constraint.FilenameValid;
89
import org.lfenergy.compas.core.commons.constraint.XmlAnyElementValid;
910
import org.w3c.dom.Element;
1011

11-
import javax.validation.constraints.NotBlank;
1212
import javax.validation.constraints.Size;
1313
import javax.xml.bind.annotation.*;
1414
import java.util.List;
@@ -20,7 +20,7 @@
2020
@XmlRootElement(name = "CreateRequest", namespace = SCL_DATA_SERVICE_V1_NS_URI)
2121
@XmlAccessorType(XmlAccessType.FIELD)
2222
public class CreateRequest {
23-
@NotBlank
23+
@FilenameValid
2424
@Schema(description = "The name that will be stored as Private Element and can later be used to determine the filename.",
2525
example = "STATION-0012312")
2626
@XmlElement(name = "Name", namespace = SCL_DATA_SERVICE_V1_NS_URI, required = true)

app/src/main/resources/ValidationMessages.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
javax.validation.constraints.NotNull.message = Value must not be null.
66
javax.validation.constraints.NotBlank.message = Value must not be blank.
77

8+
org.lfenergy.compas.FilenameValid.message = Name is not a correct name to be used later as filename.
89
org.lfenergy.compas.changeset.notnull.message = ChangeSet is null or has an invalid value.
910
org.lfenergy.compas.XmlAnyElementValid.unexpected.message = The XML Any Element contains unexpected elements. Element Name should be '{elementName}' with namespace '{elementNamespace}'.
1011
org.lfenergy.compas.XmlAnyElementValid.moreElements.message = There are more or less Elements found then expected (between {min} and {max}) in the XML Any Element.

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ SPDX-License-Identifier: Apache-2.0
2424
<surefire-plugin.version>3.0.0-M5</surefire-plugin.version>
2525
<sonarqube-plugin.version>3.2.0</sonarqube-plugin.version>
2626

27-
<compas.core.version>0.2.0</compas.core.version>
27+
<compas.core.version>0.2.1</compas.core.version>
2828
<jakarta-bind-api.version>2.3.3</jakarta-bind-api.version>
2929
<jakarta-cdi-api.version>2.0.2</jakarta-cdi-api.version>
3030
<microprofile-config-api.version>2.0</microprofile-config-api.version>
@@ -78,7 +78,7 @@ SPDX-License-Identifier: Apache-2.0
7878
<artifactId>repository-basex</artifactId>
7979
<version>${project.version}</version>
8080
</dependency>
81-
81+
8282
<dependency>
8383
<groupId>org.lfenergy.compas.core</groupId>
8484
<artifactId>commons</artifactId>

0 commit comments

Comments
 (0)