-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update sds schema validation #1538
Open
VirajP1002
wants to merge
13
commits into
main
Choose a base branch
from
update-sds-schema-validation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a951b06
Get sds_schema_version from the schema and pass it as a parameter in …
VirajP1002 82db7a0
Add the sds_schema_version as a parameter where the default is none s…
VirajP1002 8755362
Add tests to show the sds_schema_version with valid and invalid values
VirajP1002 35e1f11
Remove older logic to validate sds schema versions
VirajP1002 3c28043
Add the sds_schema_version parameters for it to validated
VirajP1002 578a189
Add tests to show questionnaire schema_version being validated agains…
VirajP1002 42424a8
Update test_supplementary.json to include new sds_schema_version field
VirajP1002 06646f3
Merge branch 'main' into update-sds-schema-validation
VirajP1002 e2ae6cb
Add a new questionnaire schema with the new sds_schema version field
VirajP1002 c512778
Merge branch 'main' into update-sds-schema-validation
VirajP1002 0f97cba
Address review comments
VirajP1002 efe0d02
Format
VirajP1002 2631959
Merge branch 'main' into update-sds-schema-validation
VirajP1002 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,3 @@ | |
|
||
class AuthPayloadVersion(Enum): | ||
V2 = "v2" | ||
|
||
|
||
class SupplementaryDataSchemaVersion(Enum): | ||
V2 = "v2" | ||
V1 = "v1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
192 changes: 192 additions & 0 deletions
192
schemas/test/en/test_supplementary_data_with_sds_schema_version.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
{ | ||
"mime_type": "application/json/ons/eq", | ||
"language": "en", | ||
"schema_version": "0.0.1", | ||
"sds_schema_version": "v1", | ||
"data_version": "0.0.3", | ||
"survey_id": "123", | ||
"title": "Test Supplementary Data with sds_schema_version Field", | ||
"theme": "default", | ||
"description": "A questionnaire to demo the support of the sds_schema_version field in schemas", | ||
"metadata": [ | ||
{ | ||
"name": "survey_id", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "user_id", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "period_id", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "ru_name", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "sds_dataset_id", | ||
"type": "string" | ||
} | ||
], | ||
"supplementary_data": { | ||
"lists": ["employees", "products"] | ||
}, | ||
"questionnaire_flow": { | ||
"type": "Hub", | ||
"options": { | ||
"required_completed_sections": ["introduction-section"] | ||
} | ||
}, | ||
"post_submission": { | ||
"view_response": true | ||
}, | ||
"sections": [ | ||
{ | ||
"id": "introduction-section", | ||
"title": "Introduction", | ||
"groups": [ | ||
{ | ||
"id": "introduction-group", | ||
"title": "Introduction Group", | ||
"blocks": [ | ||
{ | ||
"id": "loaded-successfully-block", | ||
"type": "Interstitial", | ||
"content": { | ||
"title": "Supplementary Data", | ||
"contents": [ | ||
{ | ||
"title": "You have successfully loaded Supplementary data", | ||
"description": { | ||
"text": "List of products: {products}", | ||
"placeholders": [ | ||
{ | ||
"placeholder": "products", | ||
"transforms": [ | ||
{ | ||
"transform": "format_list", | ||
"arguments": { | ||
"list_to_format": { | ||
"source": "supplementary_data", | ||
"identifier": "products", | ||
"selectors": ["name"] | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"guidance": { | ||
"contents": [ | ||
{ | ||
"description": { | ||
"text": "The purpose of this block is to test the survey opens successfully, given that sds_schema_version (defined in the questionnaire schema) matches the version set in the supplementary data payload. Separate to using the supplementary data, the surnames of the employees are: {surnames}.", | ||
"placeholders": [ | ||
{ | ||
"placeholder": "surnames", | ||
"transforms": [ | ||
{ | ||
"transform": "concatenate_list", | ||
"arguments": { | ||
"list_to_concatenate": [ | ||
{ | ||
"source": "supplementary_data", | ||
"identifier": "employees", | ||
"selectors": ["personal_details", "surname"] | ||
} | ||
], | ||
"delimiter": ", " | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"id": "introduction-block", | ||
"type": "Introduction", | ||
"primary_content": [ | ||
{ | ||
"id": "business-details", | ||
"title": { | ||
"text": "You are completing this survey for {company_name}", | ||
"placeholders": [ | ||
{ | ||
"placeholder": "company_name", | ||
"value": { | ||
"source": "supplementary_data", | ||
"identifier": "company_name" | ||
} | ||
} | ||
] | ||
}, | ||
"contents": [ | ||
{ | ||
"description": { | ||
"text": "If the company details or structure have changed contact us on {telephone_number_link}", | ||
"placeholders": [ | ||
{ | ||
"placeholder": "telephone_number_link", | ||
"value": { | ||
"source": "supplementary_data", | ||
"identifier": "company_details", | ||
"selectors": ["telephone_number"] | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"guidance": { | ||
"contents": [ | ||
{ | ||
"title": "Guidance for completing this survey", | ||
"list": [ | ||
"The company name, telephone number all come from supplementary data", | ||
"if you picked the supplementary dataset with guidance, there will be a 3rd bullet point below this one, with the supplementary guidance.", | ||
{ | ||
"text": "{survey_guidance}", | ||
"placeholders": [ | ||
{ | ||
"placeholder": "survey_guidance", | ||
"transforms": [ | ||
{ | ||
"transform": "first_non_empty_item", | ||
"arguments": { | ||
"items": [ | ||
{ | ||
"source": "supplementary_data", | ||
"identifier": "guidance" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new schema is not actually being used anywhere?