From 24d4cf3f907a92274c07719fb49b6b6f245da4f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20M=C3=B6ller?= Date: Tue, 14 Nov 2023 17:48:41 +0100 Subject: [PATCH] test: remove null values from example files These went unnoticed previously since the JSON schema doesn't prohibit additional attributes. Now that the `modelType` is defined as a constant string per definition, a `Property` object only matches against the corresponding definition, allowing more strict validation, that catches errors such as these null values. --- .../files/test_demo_full_example.json | 15 ++------------- .../aasx/data.json | 15 ++------------- .../test_demo_full_example_wrong_attribute.json | 15 ++------------- 3 files changed, 6 insertions(+), 39 deletions(-) diff --git a/test/compliance_tool/files/test_demo_full_example.json b/test/compliance_tool/files/test_demo_full_example.json index 95a70030f..31fde424d 100644 --- a/test/compliance_tool/files/test_demo_full_example.json +++ b/test/compliance_tool/files/test_demo_full_example.json @@ -1758,7 +1758,6 @@ { "idShort": "ExampleFile", "modelType": "File", - "value": null, "contentType": "application/pdf" }, { @@ -1770,16 +1769,13 @@ "idShort": "ExampleProperty", "category": "PARAMETER", "modelType": "Property", - "value": null, "valueType": "xs:string" }, { "idShort": "ExampleRange", "category": "PARAMETER", "modelType": "Range", - "valueType": "xs:int", - "min": null, - "max": null + "valueType": "xs:int" }, { "idShort": "ExampleReferenceElement", @@ -2590,7 +2586,6 @@ ] }, "kind": "Template", - "value": null, "valueType": "xs:string" } } @@ -2621,7 +2616,6 @@ ] }, "kind": "Template", - "value": null, "valueType": "xs:string" } } @@ -2652,7 +2646,6 @@ ] }, "kind": "Template", - "value": null, "valueType": "xs:string" } } @@ -2820,7 +2813,6 @@ ] }, "kind": "Template", - "value": null, "valueType": "xs:string" }, { @@ -2873,7 +2865,6 @@ }, "kind": "Template", "valueType": "xs:int", - "min": null, "max": "100" }, { @@ -2901,8 +2892,7 @@ }, "kind": "Template", "valueType": "xs:int", - "min": "0", - "max": null + "min": "0" }, { "idShort": "ExampleBlob", @@ -2954,7 +2944,6 @@ ] }, "kind": "Template", - "value": null, "contentType": "application/pdf" }, { diff --git a/test/compliance_tool/files/test_demo_full_example_json_aasx/aasx/data.json b/test/compliance_tool/files/test_demo_full_example_json_aasx/aasx/data.json index 28dca800d..7172735e6 100644 --- a/test/compliance_tool/files/test_demo_full_example_json_aasx/aasx/data.json +++ b/test/compliance_tool/files/test_demo_full_example_json_aasx/aasx/data.json @@ -1766,7 +1766,6 @@ { "idShort": "ExampleFile", "modelType": "File", - "value": null, "contentType": "application/pdf" }, { @@ -1778,16 +1777,13 @@ "idShort": "ExampleProperty", "category": "PARAMETER", "modelType": "Property", - "value": null, "valueType": "xs:string" }, { "idShort": "ExampleRange", "category": "PARAMETER", "modelType": "Range", - "valueType": "xs:int", - "min": null, - "max": null + "valueType": "xs:int" }, { "idShort": "ExampleReferenceElement", @@ -2598,7 +2594,6 @@ ] }, "kind": "Template", - "value": null, "valueType": "xs:string" } } @@ -2629,7 +2624,6 @@ ] }, "kind": "Template", - "value": null, "valueType": "xs:string" } } @@ -2660,7 +2654,6 @@ ] }, "kind": "Template", - "value": null, "valueType": "xs:string" } } @@ -2828,7 +2821,6 @@ ] }, "kind": "Template", - "value": null, "valueType": "xs:string" }, { @@ -2881,7 +2873,6 @@ }, "kind": "Template", "valueType": "xs:int", - "min": null, "max": "100" }, { @@ -2909,8 +2900,7 @@ }, "kind": "Template", "valueType": "xs:int", - "min": "0", - "max": null + "min": "0" }, { "idShort": "ExampleBlob", @@ -2962,7 +2952,6 @@ ] }, "kind": "Template", - "value": null, "contentType": "application/pdf" }, { diff --git a/test/compliance_tool/files/test_demo_full_example_wrong_attribute.json b/test/compliance_tool/files/test_demo_full_example_wrong_attribute.json index 0657301b9..8f816697d 100644 --- a/test/compliance_tool/files/test_demo_full_example_wrong_attribute.json +++ b/test/compliance_tool/files/test_demo_full_example_wrong_attribute.json @@ -1758,7 +1758,6 @@ { "idShort": "ExampleFile", "modelType": "File", - "value": null, "contentType": "application/pdf" }, { @@ -1770,16 +1769,13 @@ "idShort": "ExampleProperty", "category": "PARAMETER", "modelType": "Property", - "value": null, "valueType": "xs:string" }, { "idShort": "ExampleRange", "category": "PARAMETER", "modelType": "Range", - "valueType": "xs:int", - "min": null, - "max": null + "valueType": "xs:int" }, { "idShort": "ExampleReferenceElement", @@ -2590,7 +2586,6 @@ ] }, "kind": "Template", - "value": null, "valueType": "xs:string" } } @@ -2621,7 +2616,6 @@ ] }, "kind": "Template", - "value": null, "valueType": "xs:string" } } @@ -2652,7 +2646,6 @@ ] }, "kind": "Template", - "value": null, "valueType": "xs:string" } } @@ -2820,7 +2813,6 @@ ] }, "kind": "Template", - "value": null, "valueType": "xs:string" }, { @@ -2873,7 +2865,6 @@ }, "kind": "Template", "valueType": "xs:int", - "min": null, "max": "100" }, { @@ -2901,8 +2892,7 @@ }, "kind": "Template", "valueType": "xs:int", - "min": "0", - "max": null + "min": "0" }, { "idShort": "ExampleBlob", @@ -2954,7 +2944,6 @@ ] }, "kind": "Template", - "value": null, "contentType": "application/pdf" }, {