diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index b56c3e9d..43a3eefe 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -304,7 +304,7 @@ The artifact will include extension settings for the sample Hello World extensio ``` You can optionally add `routeNamePrefix:` as a value to the yml. This setting allows you to prefix all your registered NamedRoute names. -The value must be alphanumeric and can contain `-`, `_` in the name. +The value must be alphanumeric and can contain `_` in the name. Start the sample extension with `./bin/opensearch-sdk-java` diff --git a/src/main/java/org/opensearch/sdk/rest/BaseExtensionRestHandler.java b/src/main/java/org/opensearch/sdk/rest/BaseExtensionRestHandler.java index 5f11ab3b..d4067011 100644 --- a/src/main/java/org/opensearch/sdk/rest/BaseExtensionRestHandler.java +++ b/src/main/java/org/opensearch/sdk/rest/BaseExtensionRestHandler.java @@ -44,7 +44,7 @@ */ public abstract class BaseExtensionRestHandler implements ExtensionRestHandler { - private static final String VALID_ROUTE_PREFIX_PATTERN = "^[a-zA-Z0-9-_]*$"; + private static final String VALID_ROUTE_PREFIX_PATTERN = "^[a-zA-Z0-9_]*$"; private String routeNamePrefix; @@ -89,8 +89,7 @@ public void setRouteNamePrefix(String prefix) { // we by-pass null assignment as routeNamePrefixes are not mandatory if (prefix != null && !prefix.matches(VALID_ROUTE_PREFIX_PATTERN)) { throw new OpenSearchException( - "Invalid route name prefix specified. The prefix may include the following characters" - + " 'a-z', 'A-Z', '0-9', ':', '/', '*', '_'" + "Invalid route name prefix specified. The prefix may include the following characters" + " 'a-z', 'A-Z', '0-9', '_'" ); } routeNamePrefix = prefix;