Skip to content

Commit

Permalink
[DUOS-2724][risk=no] Make file types not required and other minor fix…
Browse files Browse the repository at this point in the history
…es (#2166)
  • Loading branch information
rushtong authored Oct 19, 2023
1 parent 6ecb77b commit f43fda6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,18 @@ public void setUrl(URI url) {
this.url = url;
}

/**
* # of Participants (Required)
*/
@JsonProperty("numberOfParticipants")
public Integer getNumberOfParticipants() {
return numberOfParticipants;
}

/**
* # of Participants (Required)
*/
@JsonProperty("numberOfParticipants")
public void setNumberOfParticipants(Integer numberOfParticipants) {
this.numberOfParticipants = numberOfParticipants;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"fileType",
"functionalEquivalence",
"numberOfParticipants"
"functionalEquivalence"
})
public class FileTypeObject {

Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/dataset-registration-schema_v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,6 @@
"type": "object",
"required": [
"consentGroupName",
"fileTypes",
"numberOfParticipants"
],
"allOf": [
Expand Down Expand Up @@ -681,7 +680,6 @@
},
"fileTypes": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/$defs/fileTypeObject"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ void testParseValidateRegistrationObject_v1_consent_group_required() {
}

@Test
void testValidateDatasetRegistrationObject_v1_file_types_required() {
void testValidateDatasetRegistrationObject_v1_file_types_not_required() {
String noFileTypes = """
{
"studyType": "Observational",
Expand All @@ -545,6 +545,7 @@ void testValidateDatasetRegistrationObject_v1_file_types_required() {
"dataSubmitterUserId": 1,
"nihAnvilUse": "I am not NHGRI funded and do not plan to store data in AnVIL",
"consentGroups": [{
"numberOfParticipants": 1,
"consentGroupName": "name",
"generalResearchUse": true,
"dataAccessCommitteeId": 1,
Expand All @@ -568,6 +569,7 @@ void testValidateDatasetRegistrationObject_v1_file_types_required() {
"nihAnvilUse": "I am not NHGRI funded and do not plan to store data in AnVIL",
"consentGroups": [{
"fileTypes": [],
"numberOfParticipants": 1,
"consentGroupName": "name",
"generalResearchUse": true,
"dataAccessCommitteeId": 1,
Expand All @@ -577,10 +579,10 @@ void testValidateDatasetRegistrationObject_v1_file_types_required() {
""";

Set<ValidationMessage> errors = schemaUtil.validateSchema_v1(noFileTypes);
assertFieldHasError(errors, "fileTypes");
assertNoErrors(errors);

errors = schemaUtil.validateSchema_v1(emptyFileTypes);
assertFieldHasError(errors, "fileTypes");
assertNoErrors(errors);
}


Expand Down

0 comments on commit f43fda6

Please sign in to comment.