Skip to content
Snippets Groups Projects

Add OpenAPI spec for species search

Merged Andrey Azov requested to merge add-species-search-spec into master
+ 139
10
@@ -9,16 +9,16 @@ info:
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.0
servers:
- url: http://2020.ensembl.org/api/
- url: http://beta.ensembl.org/api/
tags:
- name: search
description: Search endpoint for in-app search aka gene-search
externalDocs:
description: Find out more
url: http://2020.ensembl.org
url: http://beta.ensembl.org
paths:
/search:
get:
post:
tags:
- search
summary: Search gene name for given genome_id
@@ -28,7 +28,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/SearchRequest'
$ref: '#/components/schemas/GeneSearchRequest'
required: true
responses:
200:
@@ -36,10 +36,28 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/SearchResult'
$ref: '#/components/schemas/GeneSearchResult'
/search/species:
get:
summary: Search for genomes using different species- or assembly-related queries
parameters:
- in: query
name: query
schema:
type: string
example: Human
description: Query string entered by the user
responses:
200:
description: Success species search response
content:
application/json:
schema:
$ref: '#/components/schemas/SpeciesSearchResponse'
components:
schemas:
SearchRequest:
GeneSearchRequest:
type: object
properties:
query:
@@ -59,7 +77,7 @@ components:
required:
- query
- genome_ids
SearchResult:
GeneSearchResult:
type: object
properties:
meta:
@@ -77,8 +95,8 @@ components:
matches:
type: array
items:
$ref: '#/components/schemas/SearchResultItem'
SearchResultItem:
$ref: '#/components/schemas/GeneSearchResultItem'
GeneSearchResultItem:
type: object
properties:
type:
@@ -136,4 +154,115 @@ components:
properties:
code:
type: string
example: forward
\ No newline at end of file
example: forward
SpeciesSearchResponse:
properties:
matches:
items:
$ref: '#/components/schemas/SpeciesSearchMatch'
type: array
meta:
properties:
total_count:
type: number
example: 98
required:
- total_count
additionalProperties: false
type: object
required:
- matches
- meta
additionalProperties: false
type: object
SpeciesSearchMatch:
properties:
genome_id:
type: string
example: a7335667-93e7-11ec-a39d-005056b38ce3
genome_tag:
nullable: true
type: string
example: grch38
common_name:
nullable: true
type: string
example: Human
scientific_name:
type: string
example: Homo sapiens
type:
$ref: '#/components/schemas/SpeciesTypeInSpeciesSearchMatch'
nullable: true
is_reference:
type: boolean
assembly:
$ref: '#/components/schemas/AssemblyInSpeciesSearchMatch'
coding_genes_count:
type: number
example: 20446
contig_n50:
nullable: true
type: number
example: 56413054
has_variation:
type: boolean
has_regulation:
type: boolean
annotation_provider:
type: string
example: Ensembl
annotation_method:
type: string
example: Full genebuild
rank:
nullable: true
type: number
example: 1
required:
- genome_id
- genome_tag
- common_name
- scientific_name
- type
- is_reference
- assembly
- coding_genes_count
- contig_n50
- has_variation
- has_regulation
- annotation_provider
- annotation_method
- rank
additionalProperties: false
type: object
AssemblyInSpeciesSearchMatch:
properties:
accession_id:
type: string
example: GCA_018466855.1
name:
type: string
example: HG02559.alt.pat.f1_v2
url:
type: string
example: https://www.ebi.ac.uk/ena/browser/view/GCA_018466855.1
required:
- accession_id
- name
- url
additionalProperties: false
type: object
SpeciesTypeInSpeciesSearchMatch:
properties:
kind:
type: string
example: population
value:
type: string
example: African Caribbean In Barbados
required:
- kind
- value
additionalProperties: false
type: object