From 6e5d4256c6218da12d21192ed7c37355da532867 Mon Sep 17 00:00:00 2001 From: Pavlo Smahin Date: Tue, 8 Sep 2026 16:02:29 +0300 Subject: [PATCH] feat(packages): remove HTML validation for package's custom display name field Closes: MODKBEKBJ-855 --- NEWS.md | 1 + .../packages/PackageCustomAttributesValidator.java | 1 - .../packages/PackageCustomAttributesValidatorTest.java | 6 ------ 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/NEWS.md b/NEWS.md index 0aae3eeb..9576ec83 100644 --- a/NEWS.md +++ b/NEWS.md @@ -10,6 +10,7 @@ * Migrate Package Endpoints to HoldingsIQ v2 API ([MODKBEKBJ-804](https://folio-org.atlassian.net/browse/MODKBEKBJ-804)) * Add additional fields to POST /eholdings/packages endpoint ([MODKBEKBJ-823](https://folio-org.atlassian.net/browse/MODKBEKBJ-823)) * Update visibility hidden reason handling ([MODKBEKBJ-823](https://folio-org.atlassian.net/browse/MODKBEKBJ-823)) +* Remove HTML validation for package's custom display name field ([MODKBEKBJ-855](https://folio-org.atlassian.net/browse/MODKBEKBJ-855)) * Add access types to eholdings/providers/{id}/packages response ([MODKBEKBJ-839](https://folio-org.atlassian.net/browse/MODKBEKBJ-839)) ### Bug fixes diff --git a/src/main/java/org/folio/rest/validator/packages/PackageCustomAttributesValidator.java b/src/main/java/org/folio/rest/validator/packages/PackageCustomAttributesValidator.java index f269b9ca..955982b0 100644 --- a/src/main/java/org/folio/rest/validator/packages/PackageCustomAttributesValidator.java +++ b/src/main/java/org/folio/rest/validator/packages/PackageCustomAttributesValidator.java @@ -32,7 +32,6 @@ private void validateCustomDescription(String description) { private void validateCustomDisplayName(String displayName) { ValidatorUtil.checkMaxLength("customDisplayName", displayName, MAX_DISPLAY_NAME_LENGTH); - ValidatorUtil.checkNoHtml("customDisplayName", displayName); } private void validateCustomAltNames(List altNames) { diff --git a/src/test/java/org/folio/rest/validator/packages/PackageCustomAttributesValidatorTest.java b/src/test/java/org/folio/rest/validator/packages/PackageCustomAttributesValidatorTest.java index 5fc8a975..b6794cc7 100644 --- a/src/test/java/org/folio/rest/validator/packages/PackageCustomAttributesValidatorTest.java +++ b/src/test/java/org/folio/rest/validator/packages/PackageCustomAttributesValidatorTest.java @@ -52,12 +52,6 @@ void shouldNotThrowWhenCustomDisplayNameIsExactlyMaxLength() { assertDoesNotThrow(() -> validator.validate(customAttributes)); } - @Test - void shouldThrowWhenCustomDisplayNameContainsHtml() { - var customAttributes = withDisplayName("name"); - assertThrows(InputValidationException.class, () -> validator.validate(customAttributes)); - } - @Test void shouldNotThrowWhenCustomDisplayNameIsNull() { var customAttributes = withDisplayName(null);