From 9416b0d07867b19fd064de73214671d065efaa9a Mon Sep 17 00:00:00 2001 From: "Ed (ODSC)" Date: Thu, 14 Nov 2024 15:28:34 +0000 Subject: [PATCH] validation_table.html: Improved messages --- cove_bods/templates/cove_bods/validation_table.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cove_bods/templates/cove_bods/validation_table.html b/cove_bods/templates/cove_bods/validation_table.html index 75ddffa..cda9559 100644 --- a/cove_bods/templates/cove_bods/validation_table.html +++ b/cove_bods/templates/cove_bods/validation_table.html @@ -26,11 +26,11 @@ {% elif errors.0.validator == "pattern" %} {{ errors.0.path_ending }} does not match the regex {{ errors.0.validator_value }} {% elif errors.0.validator == "format" and errors.0.validator_value == "date" %} - Date is not in the correct format. The correct format is YYYY-MM-DD. + {{ errors.0.path_ending }} is not a valid date. The correct format is YYYY-MM-DD. {% elif errors.0.validator == "format" and errors.0.validator_value == "date-time" %} - Date is not in the correct format. The correct format is YYYY-MM-DDT00:00:00Z. + {{ errors.0.path_ending }} is not a valid date-time. {% elif errors.0.validator == "format" and errors.0.validator_value == "uri" %} - Invalid uri found + {{ errors.0.path_ending }} is not a valid uri. {% elif errors.0.validator == "minLength" %} {{ errors.0.path_ending }} is too short. It should be at least {{ errors.0.validator_value }} characters. {% elif errors.0.validator == "maxLength" %} @@ -48,7 +48,11 @@ {% elif errors.0.validator == "dependencies" %} {{ errors.0.message }} {% elif errors.0.validator == "anyOf" %} - {{ errors.0.message }} + {{ errors.0.path_ending }} is not a valid value. Check the description of this field in the schema documentation for details. + {% elif errors.0.validator == "oneOf" %} + {{ errors.0.path_ending }} is not a valid value. Check the description of this field in the schema documentation for details. + {% elif errors.0.validator == "const" %} + {{ errors.0.path_ending }} is expected to be {{ errors.0.validator_value }} in this Statement. {% else %} {{ errors.0.validator }} = {{ errors.0.message }} {% endif %}