Skip to content

Commit

Permalink
Query data sources (#161)
Browse files Browse the repository at this point in the history
* Add paths to manage organisation data sources

* Add query type filter to `getOrganisationDataSources` path

* Add queryType to DataSource
  • Loading branch information
ChristophB authored Nov 3, 2023
1 parent d9d11f7 commit 6c7c68d
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>care.smith.top</groupId>
<artifactId>top-api</artifactId>
<version>0.9.3</version>
<version>0.9.4</version>

<name>TOP API</name>
<description>REST API of the TOP framework</description>
Expand Down
72 changes: 70 additions & 2 deletions schemas/top-api.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: 3.0.0
info:
title: TOP API
version: 0.9.3
version: 0.9.4
description: |-
API to manage phenotypes, repositories, ontologies, external terminologies and organisations and to execute phenotypic queries.
Expand Down Expand Up @@ -482,7 +482,7 @@ paths:
/data_source:
get:
operationId: getDataSources
summary: Returns all available and accessible data sources.
summary: Returns all available and accessible data sources. Only administrators should be able to perform this operation.
parameters:
- name: queryType
in: query
Expand Down Expand Up @@ -567,6 +567,71 @@ paths:
$ref: '#/components/responses/UnexpectedError'
tags:
- organisation
'/{organisationId}/data_source':
summary: Represents a data source available to a specific organisation.
parameters:
- $ref: '#/components/parameters/organisationId'
get:
operationId: getOrganisationDataSources
summary: Returns all available and accessible data sources for a specific organisation.
parameters:
- name: queryType
in: query
description: Filter by query type for which data sources can be used.
required: false
schema:
$ref: '#/components/schemas/QueryType'
responses:
'200':
description: List of data sources.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/DataSource'
'401':
$ref: '#/components/responses/Unauthorized'
default:
$ref: '#/components/responses/UnexpectedError'
tags:
- query
post:
operationId: addOrganisationDataSource
summary: 'Add a new data source, available to a specific organisation. Only administrators should be able to perform this operation.'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DataSource'
responses:
'201':
description: Data source has been added to the set.
'401':
$ref: '#/components/responses/Unauthorized'
default:
$ref: '#/components/responses/UnexpectedError'
tags:
- query
delete:
operationId: removeOrganisationDataSource
summary: Remove a data source from the set of available data sources of a specific organisation. Only administrators should be able to perform this operation.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DataSource'
responses:
'204':
description: Data source has been removed from the set.
'401':
$ref: '#/components/responses/Unauthorized'
default:
$ref: '#/components/responses/UnexpectedError'
tags:
- query
/repository:
parameters:
- $ref: '#/components/parameters/include'
Expand Down Expand Up @@ -2637,8 +2702,11 @@ components:
description: Human-readable title of the data source.
type: string
example: Example Data Source
queryType:
$ref: '#/components/schemas/QueryType'
required:
- id
- queryType
ProjectionEntry:
description: Single entry of a projection select list.
type: object
Expand Down

0 comments on commit 6c7c68d

Please sign in to comment.