From b0eacfa583a48dc6eb148b937dc8a89ef3787780 Mon Sep 17 00:00:00 2001 From: Wan <495709+wa0x6e@users.noreply.github.com> Date: Thu, 10 Oct 2024 13:41:15 +0900 Subject: [PATCH] fix: add meaninful error message for anyof validation (#1070) * fix: add meaningful error message for evm/starknet address * fix: add meaningful message for evm/starknet network --- src/schemas/space.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/schemas/space.json b/src/schemas/space.json index f325fbef4..bdc981a65 100644 --- a/src/schemas/space.json +++ b/src/schemas/space.json @@ -264,7 +264,8 @@ "anyOf": [ { "format": "evmAddress" }, { "format": "starknetAddress" } - ] + ], + "errorMessage": "Must be a valid EVM of Starknet address" }, "delegationNetwork": { "type": "string", @@ -273,7 +274,8 @@ "anyOf": [ { "snapshotNetwork": true }, { "starknetNetwork": true } - ] + ], + "errorMessage": "Must be a valid network" }, "delegationApi": { "type": "string", @@ -379,7 +381,8 @@ "anyOf": [ { "format": "evmAddress" }, { "format": "starknetAddress" } - ] + ], + "errorMessage": "Must be a valid EVM of Starknet address" }, "network": { "type": "string", @@ -387,7 +390,8 @@ "anyOf": [ { "snapshotNetwork": true }, { "starknetNetwork": true } - ] + ], + "errorMessage": "Must be a valid network" } }, "required": ["name", "address", "network"],