Skip to content

Commit

Permalink
test: remove null values from example files
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jkhsjdhjs authored and s-heppner committed Nov 14, 2023
1 parent 9a9bd8a commit 24d4cf3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 39 deletions.
15 changes: 2 additions & 13 deletions test/compliance_tool/files/test_demo_full_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -1758,7 +1758,6 @@
{
"idShort": "ExampleFile",
"modelType": "File",
"value": null,
"contentType": "application/pdf"
},
{
Expand All @@ -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",
Expand Down Expand Up @@ -2590,7 +2586,6 @@
]
},
"kind": "Template",
"value": null,
"valueType": "xs:string"
}
}
Expand Down Expand Up @@ -2621,7 +2616,6 @@
]
},
"kind": "Template",
"value": null,
"valueType": "xs:string"
}
}
Expand Down Expand Up @@ -2652,7 +2646,6 @@
]
},
"kind": "Template",
"value": null,
"valueType": "xs:string"
}
}
Expand Down Expand Up @@ -2820,7 +2813,6 @@
]
},
"kind": "Template",
"value": null,
"valueType": "xs:string"
},
{
Expand Down Expand Up @@ -2873,7 +2865,6 @@
},
"kind": "Template",
"valueType": "xs:int",
"min": null,
"max": "100"
},
{
Expand Down Expand Up @@ -2901,8 +2892,7 @@
},
"kind": "Template",
"valueType": "xs:int",
"min": "0",
"max": null
"min": "0"
},
{
"idShort": "ExampleBlob",
Expand Down Expand Up @@ -2954,7 +2944,6 @@
]
},
"kind": "Template",
"value": null,
"contentType": "application/pdf"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,6 @@
{
"idShort": "ExampleFile",
"modelType": "File",
"value": null,
"contentType": "application/pdf"
},
{
Expand All @@ -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",
Expand Down Expand Up @@ -2598,7 +2594,6 @@
]
},
"kind": "Template",
"value": null,
"valueType": "xs:string"
}
}
Expand Down Expand Up @@ -2629,7 +2624,6 @@
]
},
"kind": "Template",
"value": null,
"valueType": "xs:string"
}
}
Expand Down Expand Up @@ -2660,7 +2654,6 @@
]
},
"kind": "Template",
"value": null,
"valueType": "xs:string"
}
}
Expand Down Expand Up @@ -2828,7 +2821,6 @@
]
},
"kind": "Template",
"value": null,
"valueType": "xs:string"
},
{
Expand Down Expand Up @@ -2881,7 +2873,6 @@
},
"kind": "Template",
"valueType": "xs:int",
"min": null,
"max": "100"
},
{
Expand Down Expand Up @@ -2909,8 +2900,7 @@
},
"kind": "Template",
"valueType": "xs:int",
"min": "0",
"max": null
"min": "0"
},
{
"idShort": "ExampleBlob",
Expand Down Expand Up @@ -2962,7 +2952,6 @@
]
},
"kind": "Template",
"value": null,
"contentType": "application/pdf"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1758,7 +1758,6 @@
{
"idShort": "ExampleFile",
"modelType": "File",
"value": null,
"contentType": "application/pdf"
},
{
Expand All @@ -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",
Expand Down Expand Up @@ -2590,7 +2586,6 @@
]
},
"kind": "Template",
"value": null,
"valueType": "xs:string"
}
}
Expand Down Expand Up @@ -2621,7 +2616,6 @@
]
},
"kind": "Template",
"value": null,
"valueType": "xs:string"
}
}
Expand Down Expand Up @@ -2652,7 +2646,6 @@
]
},
"kind": "Template",
"value": null,
"valueType": "xs:string"
}
}
Expand Down Expand Up @@ -2820,7 +2813,6 @@
]
},
"kind": "Template",
"value": null,
"valueType": "xs:string"
},
{
Expand Down Expand Up @@ -2873,7 +2865,6 @@
},
"kind": "Template",
"valueType": "xs:int",
"min": null,
"max": "100"
},
{
Expand Down Expand Up @@ -2901,8 +2892,7 @@
},
"kind": "Template",
"valueType": "xs:int",
"min": "0",
"max": null
"min": "0"
},
{
"idShort": "ExampleBlob",
Expand Down Expand Up @@ -2954,7 +2944,6 @@
]
},
"kind": "Template",
"value": null,
"contentType": "application/pdf"
},
{
Expand Down

0 comments on commit 24d4cf3

Please sign in to comment.