Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions TimeSeriesAPI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ info:
This describes the datastructures of the TimeSeries stored in ElasticSearch
version: v1

servers: []
paths: {}
servers: [ ]
paths: { }

components:
schemas:
Expand All @@ -19,11 +19,11 @@ components:
type: string
format: uuid
participantId:
$ref: '#/components/schemas/Id'
$ref: 'src/main/resources/openapi/BaseComponents.yaml#/components/schemas/Id'
studyId:
$ref: '#/components/schemas/Id'
$ref: 'src/main/resources/openapi/BaseComponents.yaml#/components/schemas/Id'
moduleId:
$ref: '#/components/schemas/Id'
$ref: 'src/main/resources/openapi/BaseComponents.yaml#/components/schemas/Id'
moduleType:
type: string
dataType:
Expand Down Expand Up @@ -84,7 +84,7 @@ components:
maximum: 90
longitude:
description:
geographical longitude east or west of Greenwich, England, in `degrees`.
geographical longitude east or west of Greenwich, England, in `degrees`.
Negative values indicate `West`.
type: number
format: double
Expand Down Expand Up @@ -115,6 +115,3 @@ components:
required: [ datetime ]
externalDocs:
url: https://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_date-time

Id:
type: string
15 changes: 14 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,19 @@
<modelNameSuffix>DTO</modelNameSuffix>
</configuration>
</execution>
<execution>
<id>participant-portal-api</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/openapi/ParticipantPortalAPI.yaml</inputSpec>
<output>${project.build.directory}/generated-sources/participant-portal</output>
<apiPackage>io.redlink.more.data.api.participant.v1.webservices</apiPackage>
<modelPackage>io.redlink.more.data.api.participant.v1.model</modelPackage>
<modelNameSuffix>DTO</modelNameSuffix>
</configuration>
</execution>
<execution>
<id>garmin-api</id>
<goals>
Expand Down Expand Up @@ -458,7 +471,7 @@
<apiPackage>io.redlink.more.data.api.app.v1.webservices</apiPackage>

<generateModels>true</generateModels>
<apiPackage>io.redlink.more.data.api.app.v1.model</apiPackage>
<modelPackage>io.redlink.more.data.api.app.v1.model</modelPackage>

<generateApiTests>false</generateApiTests>
<generateApiDocumentation>true</generateApiDocumentation>
Expand Down
202 changes: 202 additions & 0 deletions src/main/resources/openapi/BaseComponents.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
openapi: 3.1.0
info:
title: Common Components API
version: 1.0.0

components:
schemas:
Study:
description:
The study object containing all information and observation
information to configure and initialize the APP
type: object
properties:
active:
description:
The current study-state. Mainly used during the registration process.
type: boolean
default: true
studyState:
type: string
enum:
- active
- paused
- closed
participant:
$ref: '#/components/schemas/SimpleParticipant'
studyTitle:
type: string
participantInfo:
type: string
consentInfo:
type: string
finishText:
type: string
contact:
$ref: '#/components/schemas/ContactInfo'
start:
type: string
format: date
end:
type: string
format: date
observations:
type: array
items:
$ref: '#/components/schemas/Observation'
minItems: 1
version:
$ref: '#/components/schemas/VersionTag'
required:
- studyTitle
- participantInfo
- consentInfo
- start
- end
- observations
- version

SimpleParticipant:
type: object
properties:
id:
type: integer
alias:
type: string

ContactInfo:
description: Contact-Information
type: object
properties:
institute:
type: string
person:
type: string
email:
type: string
phoneNumber:
type: string

Observation:
description: The configuration of an observation for the study.
type: object
properties:
observationId:
type: string
observationType:
type: string
observationTitle:
type: string
participantInfo:
type: string
configuration:
type: object
schedule:
type: array
items:
title: ObservationSchedule
type: object
properties:
start:
type: string
format: date-time
end:
type: string
format: date-time
required:
type: boolean
default: true
hidden:
type: boolean
default: false
noSchedule:
type: boolean
default: false
reminder:
type: boolean
default: false
version:
$ref: '#/components/schemas/VersionTag'
required:
- observationId
- observationType
- observationTitle
- participantInfo
- schedule
- required
- version

VersionTag:
description:
A version indicator. Currently the last-modified date in EPOCH-format
but that's not guaranteed.
type: integer
format: int64

StudyConsent:
type: object
description: Confirms the participants consent to the study including supported observations on the device.
properties:
consent:
description: Explicitly state the consent of the Participant
type: boolean
default: false
deviceId:
description: Identifier of the device used to provide consent
type: string
consentInfoMD5:
description: |
MD5-Hash of the `consentInfo` (text) the participant
actually gave consent.
type: string
observations:
type: array
items:
title: ObservationConsent
type: object
properties:
observationId:
type: string
active:
type: boolean
default: true
required:
- observationId
- active
required:
- consent
- deviceId
- consentInfoMD5
- observations

ApiKey:
description: |
Credentials for the for interacting with the backends
type: object
readOnly: true
properties:
apiId:
type: string
readOnly: true
apiKey:
type: string
readOnly: true
required:
- apiId
- apiKey

Id:
type: string

responses:
StudyInfoResponse:
description: The Study Info
content:
application/json:
schema:
$ref: '#/components/schemas/Study'

UnauthorizedApiKey:
description: |
**Authentication Required**
Login is performed via `basic-auth` using `apiId` as username and `apiKey` as password.
7 changes: 1 addition & 6 deletions src/main/resources/openapi/ExternalAPI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ paths:
items:
$ref: '#/components/schemas/Participant'
'401':
$ref: '#/components/responses/UnauthorizedApiKey'
$ref: 'BaseComponents.yaml#/components/responses/UnauthorizedApiKey'

components:
schemas:
Expand Down Expand Up @@ -202,8 +202,3 @@ components:
type: integer
format: int32
required: true

responses:
UnauthorizedApiKey:
description: Invalid/Unknown authentication Token

Loading
Loading