diff --git a/src/schemas/space.json b/src/schemas/space.json index 542f0c339..489a2bf01 100644 --- a/src/schemas/space.json +++ b/src/schemas/space.json @@ -103,6 +103,10 @@ }, "domain": { "type": "string", + "allOf": [ + { "format": "hostname" }, + { "format": "lowercase" } + ], "title": "domain", "maxLength": 64 }, diff --git a/src/utils.ts b/src/utils.ts index a3115c826..d22352070 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -113,6 +113,10 @@ ajv.addFormat('long', { validate: () => true }); +ajv.addFormat('lowercase', { + validate: (value: string) => value === value.toLowerCase() +}); + ajv.addFormat('ethValue', { validate: (value: string) => { if (!value.match(/^([0-9]|[1-9][0-9]+)(\.[0-9]+)?$/)) return false;