Skip to content

Commit

Permalink
jsonschema_validation: Add additional properties UI
Browse files Browse the repository at this point in the history
  • Loading branch information
jarofgreen committed Jun 27, 2023
1 parent 525c804 commit 06cac75
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cove_ofds/jsonschema_validation_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def add_type_to_json_schema_validation_error(data: dict) -> dict:
elif data["validator"] == "minProperties":
data["cove_type"] = "Emptyobject"

elif data["validator"] == "additionalProperties":
data["cove_type"] = "Additionalproperties"

elif data["validator"] == "format" and data["validator_value"] == "date":
data["cove_type"] = "Incorrectlyformatteddate"

Expand Down
12 changes: 12 additions & 0 deletions cove_ofds/templates/cove_ofds/jsonschema_validation_panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,18 @@ <h4 class="validation-title">
{% include "cove_ofds/jsonschema_validation_table.html" with validation_errors_for_table=validation_errors.Incorrectlyformatteduuid col_instance=True error_table_id="Incorrectlyformatteduuid" %}
{% endif %}

{% if 'Additionalproperties' in validation_errors %}
<h4 class="validation-title">
{% trans 'Additional properties within Geometry object' %}
{% include 'cove_ofds/jsonschema_validation_table_error_counter.html' with count=validation_errors.Additionalproperties|length error_table_id="Additionalproperties" %}
</h4>
<p>
Additional properties are not permitted within Geometry objects. You must remove any additional properties.
For more information, see <a href="https://open-fibre-data-standard.readthedocs.io/en/latest/reference/schema.html#geometry" target="_blank">Geometry</a>.
</p>
{% include "cove_ofds/jsonschema_validation_table.html" with validation_errors_for_table=validation_errors.Additionalproperties error_table_id="Additionalproperties" %}
{% endif %}


{% if 'unknown' in validation_errors %}
<h4 class="validation-title">
Expand Down

0 comments on commit 06cac75

Please sign in to comment.