Skip to content

Commit

Permalink
Merge branch 'fix/open-api-search' of github.com:Budibase/budibase in…
Browse files Browse the repository at this point in the history
…to examples/nextjs
  • Loading branch information
mike12345567 committed Mar 8, 2022
2 parents 55f03d3 + a3a6aeb commit 9430439
Show file tree
Hide file tree
Showing 12 changed files with 992 additions and 128 deletions.
477 changes: 429 additions & 48 deletions packages/server/specs/openapi.json

Large diffs are not rendered by default.

369 changes: 337 additions & 32 deletions packages/server/specs/openapi.yaml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions packages/server/specs/resources/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,10 @@ module.exports = new Resource()
applicationOutput: object({
data: applicationOutputSchema,
}),
applicationSearch: object({
data: {
type: "array",
items: applicationOutputSchema,
},
}),
})
6 changes: 6 additions & 0 deletions packages/server/specs/resources/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,10 @@ module.exports = new Resource()
executeQuery: executeQuerySchema,
executeQueryOutput: executeQueryOutputSchema,
query: querySchema,
querySearch: object({
data: {
type: "array",
items: querySchema,
},
}),
})
6 changes: 6 additions & 0 deletions packages/server/specs/resources/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,10 @@ module.exports = new Resource()
tableOutput: object({
data: tableOutputSchema,
}),
tableSearch: object({
data: {
type: "array",
items: tableOutputSchema,
},
}),
})
6 changes: 6 additions & 0 deletions packages/server/specs/resources/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,10 @@ module.exports = new Resource()
userOutput: object({
data: userOutputSchema,
}),
userSearch: object({
data: {
type: "array",
items: userOutputSchema,
},
}),
})
8 changes: 4 additions & 4 deletions packages/server/src/api/controllers/row/external.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ exports.handleRequest = handleRequest
exports.patch = async ctx => {
const inputs = ctx.request.body
const tableId = ctx.params.tableId
const id = breakRowIdField(inputs._id)
const id = inputs._id
// don't save the ID to db
delete inputs._id
return handleRequest(DataSourceOperation.UPDATE, tableId, {
id,
id: breakRowIdField(id),
row: inputs,
})
}
Expand Down Expand Up @@ -67,7 +67,7 @@ exports.find = async ctx => {
const id = ctx.params.rowId
const tableId = ctx.params.tableId
const response = await handleRequest(DataSourceOperation.READ, tableId, {
id,
id: breakRowIdField(id),
})
return response ? response[0] : response
}
Expand All @@ -76,7 +76,7 @@ exports.destroy = async ctx => {
const tableId = ctx.params.tableId
const id = ctx.request.body._id
const { row } = await handleRequest(DataSourceOperation.DELETE, tableId, {
id,
id: breakRowIdField(id),
})
return { response: { ok: true }, row }
}
Expand Down
9 changes: 1 addition & 8 deletions packages/server/src/api/routes/public/applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,7 @@ read.push(new Endpoint("get", "/applications/:appId", controller.read))
* content:
* application/json:
* schema:
* type: object
* required:
* - data
* properties:
* data:
* type: array
* items:
* $ref: '#/components/schemas/application'
* $ref: '#/components/schemas/applicationSearch'
* examples:
* applications:
* $ref: '#/components/examples/applications'
Expand Down
9 changes: 1 addition & 8 deletions packages/server/src/api/routes/public/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,7 @@ write.push(new Endpoint("post", "/queries/:queryId", controller.execute))
* content:
* application/json:
* schema:
* type: object
* required:
* - data
* properties:
* data:
* type: array
* items:
* $ref: '#/components/schemas/query'
* $ref: '#/components/schemas/querySearch'
* examples:
* queries:
* $ref: '#/components/examples/queries'
Expand Down
9 changes: 1 addition & 8 deletions packages/server/src/api/routes/public/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,7 @@ read.push(new Endpoint("get", "/tables/:tableId", controller.read))
* content:
* application/json:
* schema:
* type: object
* required:
* - data
* properties:
* data:
* type: array
* items:
* $ref: '#/components/schemas/table'
* $ref: '#/components/schemas/tableSearch'
* examples:
* tables:
* $ref: '#/components/examples/tables'
Expand Down
9 changes: 1 addition & 8 deletions packages/server/src/api/routes/public/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,7 @@ read.push(new Endpoint("get", "/users/:userId", controller.read))
* content:
* application/json:
* schema:
* type: object
* required:
* - data
* properties:
* data:
* type: array
* items:
* $ref: '#/components/schemas/user'
* $ref: '#/components/schemas/userSearch'
* examples:
* users:
* $ref: '#/components/examples/users'
Expand Down
Loading

0 comments on commit 9430439

Please sign in to comment.