-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathReading-API.yaml
121 lines (119 loc) · 3.43 KB
/
Reading-API.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
---
openapi: 3.0.0
info:
title: "Reading API"
description: "This is a general API specification for World Modelers reading components."
version: "0.0.1"
servers:
- url: http://localhost:8080
description: Local server for testing
paths:
/process_text:
post:
tags:
- "process"
summary: "Submit text for reading"
description: "Submit an object containing the key `text` whose value is the\
\ text to be processed by the reader."
requestBody:
description: "A `text` object."
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Text"
responses:
200:
description: "SUCCESS"
content:
application/json:
schema:
$ref: "#/components/schemas/Status"
/status/{ID}:
get:
tags:
- "status"
summary: "Submit ID and receive reading status for request"
description: "Submit an object containing the key `ID` whose value is the ID \
returned by a `process` request. Receive the status for this reading request."
parameters:
- in: path
name: ID
description: "An `ID` object."
required: true
schema:
$ref: "#/components/schemas/ID"
responses:
200:
description: "SUCCESS"
content:
application/json:
schema:
$ref: "#/components/schemas/Status"
/results/{ID}:
get:
tags:
- "results"
summary: "Submit ID and receive reading results for request"
description: "Submit an object containing the key `ID` whose value is the ID\
\ returned by a `process` request. Receive the results for this reading request\
\ if the reading is `Done`."
parameters:
- in: path
name: ID
description: "An `ID` object."
required: true
schema:
$ref: "#/components/schemas/ID"
responses:
200:
description: "SUCCESS"
content:
application/json:
schema:
$ref: "#/components/schemas/Results"
components:
schemas:
Text:
type: "object"
description: "A text object submitted for reading."
required:
- "Text"
properties:
Text:
type: "string"
example: "Flooding caused disruption in the region."
ID:
type: "string"
description: "Unique identifier for reading request"
example: "FE8201E0718AD4F97E4FAB192A2DBB5BD7CB2D6F"
Status:
type: "object"
description: "A status object describing a reading submission status."
required:
- "ID"
- "Status"
properties:
ID:
$ref: '#/components/schemas/ID'
Status:
type: "string"
example: "Processing"
description: "Reading request status"
enum:
- "Processing"
- "Done"
example:
Status: "Processing"
ID: "FE8201E0718AD4F97E4FAB192A2DBB5BD7CB2D6F"
Results:
type: "object"
description: "A result object for a completed reading."
properties:
Result:
type: "object"
description: "The result of reading."
Metadata:
type: "object"
description: "Arbitrary metadata associated with a reading."
example: {"Reader": "Eidos", "Version": "0.2.1"}