From 133ee4beec546a069e629518fe66834d6a1df0e2 Mon Sep 17 00:00:00 2001 From: Nichollette Date: Wed, 12 Feb 2025 15:45:52 -0500 Subject: [PATCH 1/3] updated smartapi docs --- SmartAPI/smartapi_openapi.yml | 96 +++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/SmartAPI/smartapi_openapi.yml b/SmartAPI/smartapi_openapi.yml index 77b1540..b10fa28 100644 --- a/SmartAPI/smartapi_openapi.yml +++ b/SmartAPI/smartapi_openapi.yml @@ -370,6 +370,74 @@ paths: $ref: '#/components/schemas/PathsResponse' tags: - metakg + /metakg/parse: + get: + summary: Parse metadata from its URL. + parameters: + - name: url + in: query + required: true + schema: + type: string + maxLength: 1000 + description: Metadata url for API document to be parsed. *Required*. + example: "https://raw.githubusercontent.com/NCATS-Tangerine/translator-api-registry/master/mygene.info/openapi_full.yml" + - name: api_details + in: query + required: false + schema: + type: boolean + description: >- + Optional, used to display API details in the response. If set to true, the response will include more information about the api. Default: false. + - name: bte + in: query + required: false + schema: + type: boolean + description: >- + Optional, used to display the BTE (BioThings Explorer) details in the response. If set to true, the response will include BTE information. Default: false. + responses: + 200: + description: Successfully parsed metadata. + content: + application/json: + schema: + $ref: '#/components/schemas/ParseResponse' + tags: + - metakg + post: + summary: Parse metadata from a given request body. + parameters: + - name: api_details + in: query + required: false + schema: + type: boolean + description: >- + Optional, used to display API details in the response. If set to true, the response will include more information about the api. Default: false. + - name: bte + in: query + required: false + schema: + type: boolean + description: >- + Optional, used to display the BTE (BioThings Explorer) details in the response. If set to true, the response will include BTE information. Default: false. + requestBody: + required: true + content: + application/json: + schema: + type: object + description: Parsed metadata JSON object in a list. + responses: + 200: + description: Successfully parsed metadata. + content: + application/json: + schema: + $ref: '#/components/schemas/ParseResponse' + tags: + - metakg components: schemas: MetakgResponse: @@ -438,3 +506,31 @@ components: properties: id: type: string + ParseResponse: + description: Array of all associations + type: array + items: + type: object + properties: + subject: + type: string + object: + type: string + predicate: + type: string + provided_by: + type: string + api: + type: object + properties: + name: + type: string + smartapi: + type: object + properties: + metadata: + type: string + ui: + type: string + id: + type: string From 2d48783e758114df7272b61ebbf3ffbd65dca325 Mon Sep 17 00:00:00 2001 From: Nichollette Date: Thu, 13 Feb 2025 13:26:15 -0500 Subject: [PATCH 2/3] removed duplicate response pattern --- SmartAPI/smartapi_openapi.yml | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/SmartAPI/smartapi_openapi.yml b/SmartAPI/smartapi_openapi.yml index b10fa28..0f307f5 100644 --- a/SmartAPI/smartapi_openapi.yml +++ b/SmartAPI/smartapi_openapi.yml @@ -402,7 +402,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ParseResponse' + $ref: '#/components/schemas/MetakgResponse' tags: - metakg post: @@ -435,7 +435,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ParseResponse' + $ref: '#/components/schemas/MetakgResponse' tags: - metakg components: @@ -506,31 +506,3 @@ components: properties: id: type: string - ParseResponse: - description: Array of all associations - type: array - items: - type: object - properties: - subject: - type: string - object: - type: string - predicate: - type: string - provided_by: - type: string - api: - type: object - properties: - name: - type: string - smartapi: - type: object - properties: - metadata: - type: string - ui: - type: string - id: - type: string From 6c7a290813575c8c36973de669759d41ef96f28d Mon Sep 17 00:00:00 2001 From: Nichollette Date: Mon, 24 Feb 2025 14:47:01 -0500 Subject: [PATCH 3/3] added yaml referenc for body request --- SmartAPI/smartapi_openapi.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SmartAPI/smartapi_openapi.yml b/SmartAPI/smartapi_openapi.yml index 0f307f5..f685e6a 100644 --- a/SmartAPI/smartapi_openapi.yml +++ b/SmartAPI/smartapi_openapi.yml @@ -429,6 +429,10 @@ paths: schema: type: object description: Parsed metadata JSON object in a list. + application/yaml: + schema: + type: object + description: Parsed metadata YAML object in a list. responses: 200: description: Successfully parsed metadata. @@ -436,6 +440,9 @@ paths: application/json: schema: $ref: '#/components/schemas/MetakgResponse' + application/yaml: + schema: + $ref: '#/components/schemas/MetakgResponse' tags: - metakg components: