From a2d0fff59c5b1babcae80e78f8066299beb67633 Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Wed, 13 Apr 2022 10:14:39 -0500 Subject: [PATCH] Add schemas for remaining responses. --- src/main/resources/docs/swagger.yaml | 128 ++++++++++++++++++++++++--- 1 file changed, 114 insertions(+), 14 deletions(-) diff --git a/src/main/resources/docs/swagger.yaml b/src/main/resources/docs/swagger.yaml index dc11f16..033f187 100644 --- a/src/main/resources/docs/swagger.yaml +++ b/src/main/resources/docs/swagger.yaml @@ -57,20 +57,14 @@ paths: content: application/json: schema: - type: object - properties: - isConsistent: - type: boolean - label: - type: string - logicalAxiomsCount: - type: integer + $ref: "#/components/schemas/kbInfo" examples: response: value: label: uberon isConsistent: true logicalAxiomsCount: 43938 + "/kbs/{kb}/subclasses": get: tags: @@ -103,7 +97,8 @@ paths: summary: an anonymous expression, using prefix definitions - name: prefixes in: query - description: JSON format prefix map, used to expand prefixes in the 'object' + description: >- + JSON format prefix map, used to expand prefixes in the 'object' expression required: false schema: @@ -141,6 +136,27 @@ paths: description: subclasses content: application/json: + schema: + type: object + additionalProperties: + type: object + properties: + value: + type: object + properties: + "@id": + type: string + format: uri + superClassOf: + type: array + items: + type: string + format: uri + value: + type: string + required: + - "@id" + - superClassOf examples: named class: value: @@ -230,6 +246,22 @@ paths: description: superclasses content: application/json: + schema: + type: object + properties: + '@id': + type: string + format: uri + value: + type: string + subClassOf: + type: array + items: + type: string + format: uri + required: + - "@id" + - subClassOf examples: named class: value: @@ -304,6 +336,27 @@ paths: description: equivalent classes content: application/json: + schema: + type: object + additionalProperties: + type: object + properties: + value: + type: object + properties: + "@id": + type: string + format: uri + equivalentClass: + type: array + items: + type: string + format: uri + value: + type: string + required: + - "@id" + - equivalentClass examples: named class: value: @@ -365,6 +418,19 @@ paths: description: satisfiability content: application/json: + schema: + type: object + properties: + "@id": + type: string + format: uri + isSatisfiable: + type: boolean + value: + type: string + required: + - "@id" + - isSatisfiable examples: named class: value: @@ -420,6 +486,17 @@ paths: description: instances content: application/json: + schema: + type: object + properties: + "@id": + type: string + format: uri + hasInstance: + type: array + items: + type: string + format: uri examples: named class: value: @@ -509,7 +586,9 @@ paths: '200': description: SPARQL results content: - application/sparql-results+xml: {} + application/sparql-results+xml: + schema: + type: string post: tags: - SPARQL @@ -530,7 +609,7 @@ paths: application/sparql-query: schema: type: string - format: SPARQL query + # format: SPARQL query example: SELECT ?x WHERE { ?x a "blah"} application/x-www-form-urlencoded: schema: @@ -538,12 +617,16 @@ paths: properties: query: type: string - format: SPARQL query + # format: SPARQL query required: - query responses: '200': - description: SPARQL results + description: SPARQL results + content: + application/json: + schema: + type: string "/kbs/{kb}/expand": get: tags: @@ -568,7 +651,9 @@ paths: '200': description: Expanded SPARQL query content: - application/sparql-query: {} + application/sparql-query: + schema: + type: string post: tags: - SPARQL @@ -602,6 +687,10 @@ paths: responses: '200': description: SPARQL results + content: + application/json: + schema: + type: string components: schemas: prefixMap: @@ -616,4 +705,15 @@ components: type: string format: JSON example: '{"obo": "http://purl.obolibrary.org/obo/", "part_of": "http://purl.obolibrary.org/obo/BFO_0000050"}' + kbInfo: + description: >- + Information provided about a specific KB. + type: object + properties: + isConsistent: + type: boolean + label: + type: string + logicalAxiomsCount: + type: integer