diff --git a/specs/adc-api-v2-openapi3.yaml b/specs/adc-api-v2-openapi3.yaml new file mode 100644 index 000000000..aa32c4d14 --- /dev/null +++ b/specs/adc-api-v2-openapi3.yaml @@ -0,0 +1,599 @@ +openapi: '3.0.0' + +info: + title: AIRR Data Commons API + version: 2.0.0 + contact: + name: AIRR Community + url: 'http://www.airr-community.org/' + email: join@airr-community.org + description: > + Major Version 2 of the Adaptive Immune Receptor Repertoire (AIRR) + data repository web service application programming interface (API). + license: + name: Creative Commons Attribution 4.0 International + url: https://creativecommons.org/licenses/by/4.0/ + +servers: + - url: https://vdjserver.org/airr/v2 + description: VDJServer ADC API + variables: + basePath: + default: /airr/v2 + - url: https://ipa1.ireceptor.org/airr/v2 + description: iReceptor IPA1 ADC API + variables: + basePath: + default: /airr/v2 + +components: + schemas: + # Info object + info_object: + type: object + description: Provides information about the API response + properties: + title: + type: string + version: + type: string + description: + type: string + contact: + type: object + properties: + name: + type: string + url: + type: string + email: + type: string + license: + type: object + properties: + name: + type: string + url: + type: string + + # Service info object. This is the object returned by the /info request, + # and provides information about the ADC repository service and its attributes and capabilities + service_info_object: + description: Provides information about the ADC repository service and it attributes and capabilities. + allOf: + - $ref: 'https://raw.githubusercontent.com/airr-community/airr-standards/master/specs/airr-schema-openapi3.yaml#/InfoObject' + - type: object + properties: + attributes: + type: object + properties: + max_size: + type: integer + max_query_size: + type: integer + last_update: + type: string + api: + $ref: 'https://raw.githubusercontent.com/airr-community/airr-standards/master/specs/airr-schema-openapi3.yaml#/InfoObject' + schema: + $ref: 'https://raw.githubusercontent.com/airr-community/airr-standards/master/specs/airr-schema-openapi3.yaml#/InfoObject' + + # POST query request + query_object: + description: Query filter and associated parameters for POST end points + type: object + properties: + filters: + type: object + format: + type: string + default: json + enum: + - json + - tsv + fields: + type: array + items: + type: string + size: + type: integer + from: + type: integer + include_fields: + type: string + enum: + - miairr + - airr-core + - airr-schema + + # list of repertoires + repertoire_list: + type: array + items: + $ref: 'https://raw.githubusercontent.com/airr-community/airr-standards/master/specs/airr-schema-openapi3.yaml#/Repertoire' + + # list of facets + facet_list: + type: array + items: + type: object + properties: + count: + type: integer + + # list of rearrangement annotations + rearrangement_list: + type: array + items: + $ref: 'https://raw.githubusercontent.com/airr-community/airr-standards/master/specs/airr-schema-openapi3.yaml#/Rearrangement' + + # list of clone annotations + clone_list: + type: array + items: + $ref: 'https://raw.githubusercontent.com/airr-community/airr-standards/master/specs/airr-schema-openapi3.yaml#/Clone' + + # The response object /repertoire endpoint + repertoire_response: + type: object + properties: + Info: + $ref: 'https://raw.githubusercontent.com/airr-community/airr-standards/master/specs/airr-schema-openapi3.yaml#/InfoObject' + Repertoire: + $ref: '#/components/schemas/repertoire_list' + Facet: + $ref: '#/components/schemas/facet_list' + + # The response object /rearrangement endpoint + rearrangement_response: + type: object + properties: + Info: + $ref: 'https://raw.githubusercontent.com/airr-community/airr-standards/master/specs/airr-schema-openapi3.yaml#/InfoObject' + Rearrangement: + $ref: '#/components/schemas/rearrangement_list' + Facet: + $ref: '#/components/schemas/facet_list' + + # The response object /clone/{clone_id} endpoint + clone_id_response: + type: object + properties: + Info: + $ref: 'https://raw.githubusercontent.com/airr-community/airr-standards/master/specs/airr-schema-openapi3.yaml#/InfoObject' + Clone: + $ref: '#/components/schemas/clone_list' + + # The response object /clone endpoint + clone_response: + type: object + properties: + Info: + $ref: 'https://raw.githubusercontent.com/airr-community/airr-standards/master/specs/airr-schema-openapi3.yaml#/InfoObject' + Clone: + $ref: '#/components/schemas/clone_list' + Facet: + $ref: '#/components/schemas/facet_list' + + # list of germline sets + germline_set_list: + type: array + items: + $ref: 'https://raw.githubusercontent.com/airr-community/airr-standards/germline/specs/airr-schema-openapi3.yaml#/GermlineSet' + + # list of allele descriptions + allele_description_list: + type: array + items: + $ref: 'https://raw.githubusercontent.com/airr-community/airr-standards/germline/specs/airr-schema-openapi3.yaml#/AlleleDescription' + + # The response object /germline endpoint + germline_set_response: + type: object + properties: + Info: + $ref: 'https://raw.githubusercontent.com/airr-community/airr-standards/master/specs/airr-schema-openapi3.yaml#/InfoObject' + GermlineSet: + $ref: '#/components/schemas/germline_set_list' + Facet: + $ref: '#/components/schemas/facet_list' + + # The response object /allele endpoint + allele_description_response: + type: object + properties: + Info: + $ref: 'https://raw.githubusercontent.com/airr-community/airr-standards/master/specs/airr-schema-openapi3.yaml#/InfoObject' + AlleleDescription: + $ref: '#/components/schemas/allele_description_list' + Facet: + $ref: '#/components/schemas/facet_list' + + # error response + error_response: + type: object + properties: + message: + type: string + description: Detail about the error + +paths: + /: + get: + description: Service heartbeat. + operationId: get_service_status + responses: + '200': + description: Service is up. + content: + application/json: + schema: + type: object + properties: + result: + type: string + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + + /info: + get: + description: Service information. + operationId: get_info + responses: + '200': + description: Success. + content: + application/json: + schema: + $ref: '#/components/schemas/service_info_object' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + + /repertoire/{repertoire_id}: + get: + description: > + Returns a repertoire based upon its identifier. + operationId: get_repertoire + tags: + - repertoires + parameters: + - name: repertoire_id + in: path + description: ID of repertoire to return + required: true + schema: + type: string + responses: + '200': + description: | + A successful call returns the repertoire data. + content: + application/json: + schema: + $ref: '#/components/schemas/repertoire_response' + '400': + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + + /repertoire: + post: + description: > + This query service returns metadata about repertoires. + operationId: query_repertoires + tags: + - repertoires + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/query_object' + responses: + '200': + description: | + A successful call returns the repertoire data. + content: + application/json: + schema: + $ref: '#/components/schemas/repertoire_response' + '400': + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + + /rearrangement/{sequence_id}: + get: + description: > + Returns a rearrangement based upon its identifier. + operationId: get_rearrangement + tags: + - rearrangements + parameters: + - name: sequence_id + in: path + description: ID of rearrangement to return + required: true + schema: + type: string + responses: + '200': + description: > + A successful call returns the rearrangement annotation data. + content: + application/json: + schema: + $ref: '#/components/schemas/rearrangement_response' + '400': + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + + /rearrangement: + post: + description: > + This query service returns rearrangement annotation data. + operationId: query_rearrangements + tags: + - rearrangements + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/query_object' + responses: + '200': + description: > + A successful call returns an array of rearrangement annotation data. + content: + application/json: + schema: + $ref: '#/components/schemas/rearrangement_response' + '400': + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + + /clone/{clone_id}: + get: + description: > + Returns a clone based upon its identifier. + operationId: get_clone + tags: + - clones + parameters: + - name: clone_id + in: path + description: ID of clone to return + required: true + schema: + type: string + responses: + '200': + description: > + A successful call returns the clone annotation data. + content: + application/json: + schema: + $ref: '#/components/schemas/clone_id_response' + '400': + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + + /clone: + post: + description: > + This query service returns clone annotation data. + operationId: query_clones + tags: + - clones + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/query_object' + responses: + '200': + description: > + A successful call returns an array of clone annotation data. + content: + application/json: + schema: + $ref: '#/components/schemas/clone_response' + '400': + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + + /germline/{germline_set_id}: + get: + description: > + Returns a germline set based upon its identifier. + operationId: get_germline_set + tags: + - germline + parameters: + - name: germline_set_id + in: path + description: ID of germline set to return + required: true + schema: + type: string + responses: + '200': + description: | + A successful call returns the germline set data. + content: + application/json: + schema: + $ref: '#/components/schemas/germline_set_response' + '400': + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + + /germline: + post: + description: > + This query service returns germline sets. + operationId: query_germline_sets + tags: + - germline + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/query_object' + responses: + '200': + description: | + A successful call returns the germline set data. + content: + application/json: + schema: + $ref: '#/components/schemas/germline_set_response' + '400': + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + + /allele/{allele_description_id}: + get: + description: > + Returns an allele description based upon its identifier. + operationId: get_allele_description + tags: + - germline + parameters: + - name: allele_description_id + in: path + description: ID of allele description to return + required: true + schema: + type: string + responses: + '200': + description: > + A successful call returns the allele description data. + content: + application/json: + schema: + $ref: '#/components/schemas/allele_description_response' + '400': + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + + /allele: + post: + description: > + This query service returns allele description data. + operationId: query_allele_descriptions + tags: + - germline + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/query_object' + responses: + '200': + description: > + A successful call returns the allele description data. + content: + application/json: + schema: + $ref: '#/components/schemas/allele_description_response' + '400': + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/error_response' +