-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtext_to_sql_openapi_schema.json
More file actions
89 lines (89 loc) · 4.05 KB
/
Copy pathtext_to_sql_openapi_schema.json
File metadata and controls
89 lines (89 loc) · 4.05 KB
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
{
"openapi": "3.0.0",
"info": {
"title": "Database schema look up and query APIs",
"version": "1.0.0",
"description": "APIs for looking up database table schemas and making queries to database tables."
},
"paths": {
"/getschema": {
"get": {
"summary": "Get a list of all tables and their schema in the database",
"description": "Get the list of all tables and their schema. Return all the table and schema information.",
"operationId": "getschema",
"responses": {
"200": {
"description": "Gets the list of table names and their schemas in the database",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"Table": {
"type": "string",
"description": "The name of the table in the database."
},
"Schema": {
"type": "string",
"description": "The schema of the table in the database. Contains all columns needed for making queries."
}
}
}
}
}
}
}
}
}
},
"/querydatabase": {
"post": {
"summary": "API to send SQL query to the database table",
"description": "Send a SQL query to the database table to retrieve information pertaining to the users question . The API takes in only one SQL query at a time, sends the SQL statement and returns the query results from the table. This API should be called for each SQL query to a database table.",
"operationId": "querydatabase",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "SQL statement to query database table."
}
},
"required": [
"query"
]
}
}
}
},
"responses": {
"200": {
"description": "Query sent successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"responsebody": {
"type": "string",
"description": "The query response from the database."
}
}
}
}
}
},
"400": {
"description": "Bad request. One or more required fields are missing or invalid."
}
}
}
}
}
}