Skip to content

Commit

Permalink
validation_table.html: Improved messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed (ODSC) committed Nov 14, 2024
1 parent 7994b21 commit 9416b0d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cove_bods/templates/cove_bods/validation_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
{% elif errors.0.validator == "pattern" %}
<strong><code>{{ errors.0.path_ending }}</code> does not match the regex <code>{{ errors.0.validator_value }}</code></strong>
{% elif errors.0.validator == "format" and errors.0.validator_value == "date" %}
<strong>Date is not in the correct format. The correct format is YYYY-MM-DD.</strong>
<strong><code>{{ errors.0.path_ending }}</code> is not a valid date. The correct format is YYYY-MM-DD.</strong>
{% elif errors.0.validator == "format" and errors.0.validator_value == "date-time" %}
<strong>Date is not in the correct format. The correct format is YYYY-MM-DDT00:00:00Z.</strong>
<strong><code>{{ errors.0.path_ending }}</code> is not a valid date-time.</strong>
{% elif errors.0.validator == "format" and errors.0.validator_value == "uri" %}
<strong>Invalid uri found</strong>
<strong><code>{{ errors.0.path_ending }}</code> is not a valid uri.</strong>
{% elif errors.0.validator == "minLength" %}
<strong><code>{{ errors.0.path_ending }}</code> is too short. It should be at least {{ errors.0.validator_value }} characters.</strong>
{% elif errors.0.validator == "maxLength" %}
Expand All @@ -48,7 +48,11 @@
{% elif errors.0.validator == "dependencies" %}
<strong>{{ errors.0.message }}</strong>
{% elif errors.0.validator == "anyOf" %}
<strong>{{ errors.0.message }}</strong>
<strong><code>{{ errors.0.path_ending }}</code> is not a valid value. Check the description of this field in the schema documentation for details.</strong>
{% elif errors.0.validator == "oneOf" %}
<strong><code>{{ errors.0.path_ending }}</code> is not a valid value. Check the description of this field in the schema documentation for details.</strong>
{% elif errors.0.validator == "const" %}
<strong><code>{{ errors.0.path_ending }}</code> is expected to be {{ errors.0.validator_value }} in this Statement.</strong>
{% else %}
<strong>{{ errors.0.validator }} = {{ errors.0.message }}</strong>
{% endif %}
Expand Down

0 comments on commit 9416b0d

Please sign in to comment.