Skip to content

Commit 1978a40

Browse files
authored
Merge pull request #29 from kschneider84/api-docs
Define report schema in more detail
2 parents c9057bf + 7efb892 commit 1978a40

3 files changed

Lines changed: 80 additions & 17 deletions

File tree

content/docs/participant-management/reports.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ A "report" is a data entry for a participant with the following fields in the da
3838
type: 'number',
3939
required: true,
4040
},
41+
modifiedAt: {
42+
description: 'Date-time format of the last modification of the report',
43+
type: 'string'
44+
},
4145
data: {
4246
description: 'Optional list of key/value data points attached to the report',
4347
type: 'Array<ReportDataItem> (optional)',

public/openapi/management-api.json

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@
803803
"properties": {
804804
"id": {
805805
"type": "string",
806-
"description": "ObjectID"
806+
"description": "MongoDB ObjectID as hex string"
807807
},
808808
"key": {
809809
"type": "string"
@@ -815,7 +815,8 @@
815815
"type": "string"
816816
},
817817
"timestamp": {
818-
"type": "integer"
818+
"type": "integer",
819+
"description": "Unix timestamp"
819820
},
820821
"modifiedAt": {
821822
"type": "string",
@@ -824,26 +825,27 @@
824825
"data": {
825826
"type": "array",
826827
"items": {
827-
"type": "object",
828-
"additionalProperties": true
828+
"$ref": "#/components/schemas/ReportData"
829829
}
830830
}
831831
},
832832
"additionalProperties": false,
833-
"description": "Report object"
833+
"description": "Report object",
834+
"required": [
835+
"key",
836+
"participantID",
837+
"timestamp"
838+
]
834839
},
835840
"ReportData": {
836841
"type": "object",
837842
"properties": {
838-
"key": {
839-
"type": "string"
840-
},
841-
"value": {
842-
"type": "string"
843-
},
844-
"dtype": {
845-
"type": "string"
846-
}
843+
"key": { "type": "string" },
844+
"value": { "type": "string" },
845+
"dtype": {
846+
"type": "string",
847+
"enum": ["date", "float", "int", "string", "rawMessage", "keyList"]
848+
}
847849
},
848850
"additionalProperties": false
849851
},

public/openapi/participant-api.json

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3619,7 +3619,21 @@
36193619
"PaginationInfos": {
36203620
"type": "object",
36213621
"description": "Pagination information",
3622-
"additionalProperties": true
3622+
"properties": {
3623+
"totalCount": {
3624+
"type": "integer"
3625+
},
3626+
"currentPage": {
3627+
"type": "integer"
3628+
},
3629+
"totalPages": {
3630+
"type": "integer"
3631+
},
3632+
"pageSize": {
3633+
"type": "integer"
3634+
}
3635+
},
3636+
"additionalProperties": false
36233637
},
36243638
"SubmissionHistory": {
36253639
"type": "object",
@@ -3628,8 +3642,51 @@
36283642
},
36293643
"Report": {
36303644
"type": "object",
3631-
"description": "report object",
3632-
"additionalProperties": true
3645+
"description": "Report object",
3646+
"properties": {
3647+
"id": {
3648+
"type": "string",
3649+
"description": "MongoDB ObjectID as hex string"
3650+
},
3651+
"key": {
3652+
"type": "string"
3653+
},
3654+
"participantID": {
3655+
"type": "string"
3656+
},
3657+
"responseID": {
3658+
"type": "string"
3659+
},
3660+
"timestamp": {
3661+
"type": "integer",
3662+
"description": "Unix timestamp"
3663+
},
3664+
"modifiedAt": {
3665+
"type": "string",
3666+
"format": "date-time"
3667+
},
3668+
"data": {
3669+
"type": "array",
3670+
"items": {
3671+
"type": "object",
3672+
"properties": {
3673+
"key": { "type": "string" },
3674+
"value": { "type": "string" },
3675+
"dtype": {
3676+
"type": "string",
3677+
"enum": ["date", "float", "int", "string", "rawMessage", "keyList"]
3678+
}
3679+
},
3680+
"additionalProperties": false
3681+
}
3682+
}
3683+
},
3684+
"required": [
3685+
"key",
3686+
"participantID",
3687+
"timestamp"
3688+
],
3689+
"additionalProperties": false
36333690
},
36343691
"Participant": {
36353692
"type": "object",

0 commit comments

Comments
 (0)