-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
2 changed files
with
126 additions
and
0 deletions.
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 |
---|---|---|
|
@@ -125,3 +125,38 @@ jobs: | |
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: lcov.info | ||
|
||
Schema: | ||
needs: Formatting | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y librocksdb-dev libsnappy-dev libsqlite3-dev | ||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Setup protoc | ||
uses: arduino/[email protected] | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Write schema | ||
run: cargo run -- server schema --output-file /tmp/openapi.schema.yaml | ||
|
||
- name: Compare YAML in git to the one just generated | ||
run: diff openapi.schema.yaml /tmp/openapi.schema.yaml | ||
|
||
- name: Validate OpenAPI schema | ||
uses: thiyagu06/openapi-validator-action@v1 | ||
with: | ||
filepath: /tmp/openapi.schema.yaml |
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,91 @@ | ||
openapi: 3.0.3 | ||
info: | ||
title: mehari | ||
description: Variant effect prediction all in Rust | ||
contact: | ||
name: Manuel Holtgrewe | ||
email: [email protected] | ||
license: | ||
name: MIT | ||
version: 0.29.6 | ||
paths: | ||
/api/v1/versionsInfo: | ||
get: | ||
tags: | ||
- versions | ||
summary: Query for consequence of a variant. | ||
operationId: versionsInfo | ||
responses: | ||
'200': | ||
description: Version information. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/VersionsInfoResponse' | ||
'500': | ||
description: Internal server error. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/CustomError' | ||
components: | ||
schemas: | ||
Assembly: | ||
type: string | ||
description: |- | ||
Assembly to be passed on the command line. | ||
Copy from annonars with extension to derive `utoipa::ToSchema`. | ||
enum: | ||
- grch37 | ||
- grch38 | ||
CustomError: | ||
type: object | ||
required: | ||
- err | ||
properties: | ||
err: | ||
type: string | ||
DataVersionEntry: | ||
type: object | ||
description: Specification of data version for a given genome build. | ||
required: | ||
- genome_build | ||
properties: | ||
genome_build: | ||
$ref: '#/components/schemas/Assembly' | ||
version_refseq: | ||
type: string | ||
description: Version of the RefSeq database, if any. | ||
nullable: true | ||
version_ensembl: | ||
type: string | ||
description: Version of the Ensembl database, if any. | ||
nullable: true | ||
SoftwareVersions: | ||
type: object | ||
description: Software version specification. | ||
required: | ||
- mehari | ||
- hgvs_rs | ||
properties: | ||
mehari: | ||
type: string | ||
description: Version of `mehari`. | ||
hgvs_rs: | ||
type: string | ||
description: Version of the `hgvs` crate. | ||
VersionsInfoResponse: | ||
type: object | ||
description: Response of the `/v1/version` endpoint. | ||
required: | ||
- software | ||
- data | ||
properties: | ||
software: | ||
$ref: '#/components/schemas/SoftwareVersions' | ||
data: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/DataVersionEntry' | ||
description: Data versions specification. |