1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-13 01:36:18 +00:00

Closes #379: spaces and colons not allowed in tag name

This commit is contained in:
bgamard
2020-02-14 21:40:13 +01:00
parent 89228a52dc
commit d619f98de7
4 changed files with 44 additions and 17 deletions

View File

@@ -111,7 +111,18 @@ public class ValidationUtil {
public static void validateHexColor(String s, String name, boolean nullable) throws ClientException {
ValidationUtil.validateLength(s, name, 7, 7, nullable);
}
/**
* Validate a tag name.
*
* @param name Name of the tag
*/
public static void validateTagName(String name) throws ClientException {
if (name.contains(" ") || name.contains(":")) {
throw new ClientException("IllegalTagName", "Spaces and colons are not allowed in tag name");
}
}
/**
* Validates that the provided string matches an URL with HTTP or HTTPS scheme.
*