See
Jira Legacy | ||||||
---|---|---|---|---|---|---|
|
Table of Contents |
---|
JSON Validation
New Design
JSON Schemas will be used to validate the structure of the JSON data and type correctness. In Java, we can use https://github.com/networknt/json-schema-validator (see also https://mvnrepository.com/artifact/com.networknt/json-schema-validator). This library was chosen because it’s compatible with both Jackson and Schema Draft 7.
JSON Schemas will be loaded from the mapping at https://github.com/BridgeDigitalHealth/mobile-client-json/blob/main/archive-map.json For each file in the uploaded zip file, we will use the filename to grab the correct schema, and then validate the file against that schema.
Previous experience tells us that researchers still want data even if it fails validation. However, we will log a message to the logs if it fails validation. We will use a Log Scan to add this to our dashboards so we can monitor and detect invalid uploads and incorrect schemas and fix app issues and systemic issues.
Open Questions:
The mapping looks very sparse. The only file that has a schema is metadata.json. Everything else appears to be specific to the MTB app or assessments. Do we plan to update this mapping?
If we need to write a new schemas anyway, does it make more sense to put them into AssessmentResources, so we don’t have to load GitHub URLs and parse JSON files?
Are we only going to use the filename mapping? Or are we also going to use assessment and app mapping?
Old Design
JSON Schemas can be added as an Assessment Resource. Pre-req
Jira Legacy | ||||||
---|---|---|---|---|---|---|
|
JSON-to-Table-Row (see
Jira Legacy | ||||||
---|---|---|---|---|---|---|
|
Table Column Validation
A list of table columns will be added as an Assessment Resource. The format will be a simple JSON Array of strings, where the strings are the names of the expected table columns (excluding common metadata columns).
...