1
0
Fork 0
mirror of synced 2024-09-05 20:21:18 +12:00

Adding in request bodies.

This commit is contained in:
mike12345567 2022-02-22 14:28:57 +00:00
parent be07f2ffb7
commit d08c3bd6b5
7 changed files with 172 additions and 65 deletions

View file

@ -848,6 +848,7 @@
} }
}, },
"rowOutput": { "rowOutput": {
"type": "object",
"properties": { "properties": {
"row": { "row": {
"description": "The row to be created/updated, based on the table schema.", "description": "The row to be created/updated, based on the table schema.",
@ -873,6 +874,15 @@
} }
} }
} }
},
"nameSearch": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name to be used when searching - this will be used in a case insensitive starts with match."
}
}
} }
} }
}, },
@ -893,6 +903,16 @@
"$ref": "#/components/parameters/appId" "$ref": "#/components/parameters/appId"
} }
], ],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/nameSearch"
}
}
}
},
"responses": { "responses": {
"200": { "200": {
"description": "Returns the applications that were found based on the search parameters.", "description": "Returns the applications that were found based on the search parameters.",
@ -931,6 +951,16 @@
"$ref": "#/components/parameters/appId" "$ref": "#/components/parameters/appId"
} }
], ],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/application"
}
}
}
},
"responses": { "responses": {
"200": { "200": {
"description": "Returns the created application.", "description": "Returns the created application.",
@ -961,6 +991,16 @@
"$ref": "#/components/parameters/appIdUrl" "$ref": "#/components/parameters/appIdUrl"
} }
], ],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/application"
}
}
}
},
"responses": { "responses": {
"200": { "200": {
"description": "Returns the updated application.", "description": "Returns the updated application.",
@ -1047,6 +1087,16 @@
"$ref": "#/components/parameters/appId" "$ref": "#/components/parameters/appId"
} }
], ],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/nameSearch"
}
}
}
},
"responses": { "responses": {
"200": { "200": {
"description": "Returns the queries found based on the search parameters.", "description": "Returns the queries found based on the search parameters.",
@ -1457,16 +1507,11 @@
} }
], ],
"requestBody": { "requestBody": {
"required": true,
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"type": "object", "$ref": "#/components/schemas/nameSearch"
"properties": {
"name": {
"type": "string",
"description": "The name of the table, this is a case insensitive search using the provided name as a starts with search."
}
}
} }
} }
} }
@ -1542,9 +1587,9 @@
} }
} }
}, },
"/tables/:tableId": { "/tables/{tableId}": {
"put": { "put": {
"summary": "Update the specified table. This can be for internal or external tables.", "summary": "Update the specified table.",
"tags": [ "tags": [
"tables" "tables"
], ],
@ -1587,9 +1632,7 @@
} }
} }
} }
}
}, },
"/tables/{tableId}": {
"delete": { "delete": {
"summary": "Delete a single table and all of its data.", "summary": "Delete a single table and all of its data.",
"tags": [ "tags": [
@ -1664,6 +1707,16 @@
"$ref": "#/components/parameters/appId" "$ref": "#/components/parameters/appId"
} }
], ],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/nameSearch"
}
}
}
},
"responses": { "responses": {
"200": { "200": {
"description": "Returns the found users based on search parameters.", "description": "Returns the found users based on search parameters.",

View file

@ -633,6 +633,7 @@ components:
type: object type: object
properties: {} properties: {}
rowOutput: rowOutput:
type: object
properties: properties:
row: row:
description: The row to be created/updated, based on the table schema. description: The row to be created/updated, based on the table schema.
@ -644,6 +645,13 @@ components:
- type: integer - type: integer
- type: array - type: array
- type: boolean - type: boolean
nameSearch:
type: object
properties:
name:
type: string
description: The name to be used when searching - this will be used in a case
insensitive starts with match.
security: security:
- ApiKeyAuth: [] - ApiKeyAuth: []
paths: paths:
@ -654,6 +662,12 @@ paths:
- applications - applications
parameters: parameters:
- $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/appId"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/nameSearch"
responses: responses:
"200": "200":
description: Returns the applications that were found based on the search description: Returns the applications that were found based on the search
@ -677,6 +691,12 @@ paths:
- applications - applications
parameters: parameters:
- $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/appId"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/application"
responses: responses:
"200": "200":
description: Returns the created application. description: Returns the created application.
@ -694,6 +714,12 @@ paths:
- applications - applications
parameters: parameters:
- $ref: "#/components/parameters/appIdUrl" - $ref: "#/components/parameters/appIdUrl"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/application"
responses: responses:
"200": "200":
description: Returns the updated application. description: Returns the updated application.
@ -743,6 +769,12 @@ paths:
- queries - queries
parameters: parameters:
- $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/appId"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/nameSearch"
responses: responses:
"200": "200":
description: Returns the queries found based on the search parameters. description: Returns the queries found based on the search parameters.
@ -1004,15 +1036,11 @@ paths:
parameters: parameters:
- $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/appId"
requestBody: requestBody:
required: true
content: content:
application/json: application/json:
schema: schema:
type: object $ref: "#/components/schemas/nameSearch"
properties:
name:
type: string
description: The name of the table, this is a case insensitive search using the
provided name as a starts with search.
responses: responses:
"200": "200":
description: Returns the found tables, based on the search parameters. description: Returns the found tables, based on the search parameters.
@ -1054,9 +1082,9 @@ paths:
examples: examples:
table: table:
$ref: "#/components/examples/table" $ref: "#/components/examples/table"
/tables/:tableId: "/tables/{tableId}":
put: put:
summary: Update the specified table. This can be for internal or external tables. summary: Update the specified table.
tags: tags:
- tables - tables
parameters: parameters:
@ -1080,7 +1108,6 @@ paths:
examples: examples:
table: table:
$ref: "#/components/examples/table" $ref: "#/components/examples/table"
"/tables/{tableId}":
delete: delete:
summary: Delete a single table and all of its data. summary: Delete a single table and all of its data.
tags: tags:
@ -1122,6 +1149,12 @@ paths:
- users - users
parameters: parameters:
- $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/appId"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/nameSearch"
responses: responses:
"200": "200":
description: Returns the found users based on search parameters. description: Returns the found users based on search parameters.

View file

@ -144,44 +144,39 @@ exports.table = {
}, },
} }
exports.query = { function object(props) {
return {
type: "object", type: "object",
properties: {}, properties: props,
}
} }
exports.user = { exports.query = object({})
type: "object",
properties: {},
}
exports.application = { exports.user = object({})
type: "object",
properties: {},
}
exports.applicationOutput = { exports.application = object({})
type: "object",
properties: { exports.applicationOutput = object({
application: exports.application, application: exports.application,
}, })
}
exports.tableOutput = { exports.tableOutput = object({
type: "object",
properties: {
table: exports.table, table: exports.table,
}, })
}
exports.userOutput = { exports.userOutput = object({
type: "object",
properties: {
user: exports.user, user: exports.user,
}, })
}
exports.rowOutput = { exports.rowOutput = object({
properties: {
row: exports.row, row: exports.row,
})
exports.nameSearch = object({
name: {
type: "string",
description:
"The name to be used when searching - this will be used in a case insensitive starts with match.",
}, },
} })

View file

@ -12,6 +12,12 @@ const router = Router()
* - applications * - applications
* parameters: * parameters:
* - $ref: '#/components/parameters/appId' * - $ref: '#/components/parameters/appId'
* requestBody:
* required: true
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/nameSearch'
* responses: * responses:
* 200: * 200:
* description: Returns the applications that were found based on the search parameters. * description: Returns the applications that were found based on the search parameters.
@ -39,6 +45,12 @@ router.post("/applications/search", controller.search)
* - applications * - applications
* parameters: * parameters:
* - $ref: '#/components/parameters/appId' * - $ref: '#/components/parameters/appId'
* requestBody:
* required: true
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/application'
* responses: * responses:
* 200: * 200:
* description: Returns the created application. * description: Returns the created application.
@ -61,6 +73,12 @@ router.post("/applications", controller.create)
* - applications * - applications
* parameters: * parameters:
* - $ref: '#/components/parameters/appIdUrl' * - $ref: '#/components/parameters/appIdUrl'
* requestBody:
* required: true
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/application'
* responses: * responses:
* 200: * 200:
* description: Returns the updated application. * description: Returns the updated application.

View file

@ -12,6 +12,12 @@ const router = Router()
* - queries * - queries
* parameters: * parameters:
* - $ref: '#/components/parameters/appId' * - $ref: '#/components/parameters/appId'
* requestBody:
* required: true
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/nameSearch'
* responses: * responses:
* 200: * 200:
* description: Returns the queries found based on the search parameters. * description: Returns the queries found based on the search parameters.

View file

@ -13,15 +13,11 @@ const router = Router()
* parameters: * parameters:
* - $ref: '#/components/parameters/appId' * - $ref: '#/components/parameters/appId'
* requestBody: * requestBody:
* required: true
* content: * content:
* application/json: * application/json:
* schema: * schema:
* type: object * $ref: '#/components/schemas/nameSearch'
* properties:
* name:
* type: string
* description: The name of the table, this is a case insensitive search using the provided
* name as a starts with search.
* responses: * responses:
* 200: * 200:
* description: Returns the found tables, based on the search parameters. * description: Returns the found tables, based on the search parameters.
@ -73,9 +69,9 @@ router.post("/tables", controller.create)
/** /**
* @openapi * @openapi
* /tables/:tableId: * /tables/{tableId}:
* put: * put:
* summary: Update the specified table. This can be for internal or external tables. * summary: Update the specified table.
* tags: * tags:
* - tables * - tables
* parameters: * parameters:

View file

@ -12,6 +12,12 @@ const router = Router()
* - users * - users
* parameters: * parameters:
* - $ref: '#/components/parameters/appId' * - $ref: '#/components/parameters/appId'
* requestBody:
* required: true
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/nameSearch'
* responses: * responses:
* 200: * 200:
* description: Returns the found users based on search parameters. * description: Returns the found users based on search parameters.