@budibase/server 1.0.98 → 1.0.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builder/assets/index.cca3db8c.js +1291 -0
- package/builder/assets/{index.7c8961b4.css → index.ea3718aa.css} +2 -2
- package/builder/assets/{vendor.a7c6ad0a.js → vendor.8e34a169.js} +1 -1
- package/builder/index.html +3 -3
- package/coverage/clover.xml +354 -334
- package/coverage/coverage-final.json +15 -15
- package/coverage/lcov-report/api/controllers/analytics.js.html +1 -1
- package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/controllers/application.js.html +1 -1
- package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
- package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
- package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
- package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
- package/coverage/lcov-report/api/controllers/component.js.html +4 -4
- package/coverage/lcov-report/api/controllers/datasource.js.html +1 -1
- package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
- package/coverage/lcov-report/api/controllers/index.html +18 -18
- package/coverage/lcov-report/api/controllers/integration.js.html +59 -11
- package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
- package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
- package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
- package/coverage/lcov-report/api/controllers/permission.js.html +7 -7
- package/coverage/lcov-report/api/controllers/query/index.html +1 -1
- package/coverage/lcov-report/api/controllers/query/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/query/validation.js.html +2 -2
- package/coverage/lcov-report/api/controllers/role.js.html +1 -1
- package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/external.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/index.html +10 -10
- package/coverage/lcov-report/api/controllers/row/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internal.js.html +19 -7
- package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/utils.js.html +6 -6
- package/coverage/lcov-report/api/controllers/screen.js.html +1 -1
- package/coverage/lcov-report/api/controllers/script.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/internal.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
- package/coverage/lcov-report/api/controllers/user.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
- package/coverage/lcov-report/api/controllers/webhook.js.html +1 -1
- package/coverage/lcov-report/api/index.html +1 -1
- package/coverage/lcov-report/api/index.js.html +1 -1
- package/coverage/lcov-report/api/routes/analytics.js.html +3 -3
- package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/routes/application.js.html +1 -1
- package/coverage/lcov-report/api/routes/auth.js.html +1 -1
- package/coverage/lcov-report/api/routes/automation.js.html +1 -1
- package/coverage/lcov-report/api/routes/backup.js.html +1 -1
- package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
- package/coverage/lcov-report/api/routes/component.js.html +1 -1
- package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
- package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
- package/coverage/lcov-report/api/routes/dev.js.html +1 -1
- package/coverage/lcov-report/api/routes/index.html +1 -1
- package/coverage/lcov-report/api/routes/index.js.html +1 -1
- package/coverage/lcov-report/api/routes/integration.js.html +1 -1
- package/coverage/lcov-report/api/routes/layout.js.html +1 -1
- package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
- package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
- package/coverage/lcov-report/api/routes/permission.js.html +1 -1
- package/coverage/lcov-report/api/routes/query.js.html +1 -1
- package/coverage/lcov-report/api/routes/role.js.html +1 -1
- package/coverage/lcov-report/api/routes/routing.js.html +1 -1
- package/coverage/lcov-report/api/routes/row.js.html +1 -1
- package/coverage/lcov-report/api/routes/screen.js.html +1 -1
- package/coverage/lcov-report/api/routes/script.js.html +1 -1
- package/coverage/lcov-report/api/routes/static.js.html +1 -1
- package/coverage/lcov-report/api/routes/table.js.html +2 -2
- package/coverage/lcov-report/api/routes/templates.js.html +1 -1
- package/coverage/lcov-report/api/routes/user.js.html +1 -1
- package/coverage/lcov-report/api/routes/utils/index.html +1 -1
- package/coverage/lcov-report/api/routes/utils/validators.js.html +1 -1
- package/coverage/lcov-report/api/routes/view.js.html +1 -1
- package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
- package/coverage/lcov-report/automations/actions.js.html +1 -1
- package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
- package/coverage/lcov-report/automations/bullboard.js.html +1 -1
- package/coverage/lcov-report/automations/index.html +12 -12
- package/coverage/lcov-report/automations/index.js.html +1 -1
- package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
- package/coverage/lcov-report/automations/steps/createRow.js.html +1 -1
- package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
- package/coverage/lcov-report/automations/steps/deleteRow.js.html +1 -1
- package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
- package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
- package/coverage/lcov-report/automations/steps/index.html +1 -1
- package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
- package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
- package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
- package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
- package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
- package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
- package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
- package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
- package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
- package/coverage/lcov-report/automations/triggers.js.html +1 -1
- package/coverage/lcov-report/automations/utils.js.html +20 -8
- package/coverage/lcov-report/constants/index.html +1 -1
- package/coverage/lcov-report/constants/index.js.html +1 -1
- package/coverage/lcov-report/constants/layouts.js.html +1 -1
- package/coverage/lcov-report/constants/screens.js.html +1 -1
- package/coverage/lcov-report/db/client.js.html +1 -1
- package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
- package/coverage/lcov-report/db/index.html +1 -1
- package/coverage/lcov-report/db/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.js.html +10 -10
- package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +7 -7
- package/coverage/lcov-report/db/newid.js.html +2 -2
- package/coverage/lcov-report/db/utils.js.html +2 -2
- package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
- package/coverage/lcov-report/events/index.html +1 -1
- package/coverage/lcov-report/events/index.js.html +1 -1
- package/coverage/lcov-report/events/utils.js.html +1 -1
- package/coverage/lcov-report/index.html +31 -31
- package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
- package/coverage/lcov-report/integrations/tests/index.html +1 -1
- package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
- package/coverage/lcov-report/middleware/authorized.js.html +75 -15
- package/coverage/lcov-report/middleware/builder.js.html +1 -1
- package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
- package/coverage/lcov-report/middleware/index.html +15 -15
- package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
- package/coverage/lcov-report/middleware/publicApi.js.html +1 -1
- package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
- package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
- package/coverage/lcov-report/middleware/usageQuota.js.html +1 -1
- package/coverage/lcov-report/middleware/utils.js.html +1 -1
- package/coverage/lcov-report/threads/automation.js.html +1 -1
- package/coverage/lcov-report/threads/index.html +1 -1
- package/coverage/lcov-report/threads/index.js.html +1 -1
- package/coverage/lcov-report/threads/query.js.html +1 -1
- package/coverage/lcov-report/threads/utils.js.html +1 -1
- package/coverage/lcov-report/utilities/bcrypt.js.html +1 -1
- package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
- package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
- package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
- package/coverage/lcov-report/utilities/global.js.html +1 -1
- package/coverage/lcov-report/utilities/index.html +1 -1
- package/coverage/lcov-report/utilities/index.js.html +1 -1
- package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
- package/coverage/lcov-report/utilities/queue/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.js.html +12 -12
- package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +8 -8
- package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
- package/coverage/lcov-report/utilities/security.js.html +1 -1
- package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/index.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
- package/coverage/lcov-report/utilities/users.js.html +1 -1
- package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
- package/coverage/lcov.info +584 -546
- package/dist/api/controllers/integration.js +15 -1
- package/dist/api/controllers/permission.js +3 -4
- package/dist/api/controllers/query/import/index.js +2 -1
- package/dist/api/controllers/query/import/sources/base/index.js +12 -1
- package/dist/api/controllers/query/import/sources/curl.js +2 -2
- package/dist/api/controllers/query/import/sources/openapi3.js +174 -0
- package/dist/api/controllers/query/import/sources/tests/openapi3/data/crud/crud.json +253 -0
- package/dist/api/controllers/query/import/sources/tests/openapi3/data/petstore/petstore.json +1225 -0
- package/dist/api/controllers/row/internal.js +2 -1
- package/dist/api/routes/analytics.js +2 -2
- package/dist/api/routes/table.js +1 -1
- package/dist/automations/utils.js +3 -1
- package/dist/definitions/datasource.js +1 -0
- package/dist/environment.js +2 -0
- package/dist/integrations/base/sql.js +16 -9
- package/dist/integrations/dynamodb.js +3 -1
- package/dist/integrations/firebase.js +192 -0
- package/dist/integrations/googlesheets.js +17 -1
- package/dist/integrations/index.js +4 -1
- package/dist/integrations/mysql.js +14 -1
- package/dist/integrations/rest.js +2 -1
- package/dist/middleware/authorized.js +24 -7
- package/dist/package.json +7 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -5
- package/scripts/dev/manage.js +2 -1
- package/specs/openapi.json +23 -3
- package/specs/openapi.yaml +20 -4
- package/specs/resources/query.js +27 -5
- package/src/api/controllers/integration.js +17 -1
- package/src/api/controllers/permission.js +3 -3
- package/src/api/controllers/query/import/index.ts +2 -1
- package/src/api/controllers/query/import/sources/base/index.ts +12 -2
- package/src/api/controllers/query/import/sources/curl.ts +2 -2
- package/src/api/controllers/query/import/sources/openapi3.ts +205 -0
- package/src/api/controllers/query/import/sources/tests/openapi3/data/crud/crud.json +253 -0
- package/src/api/controllers/query/import/sources/tests/openapi3/data/crud/crud.yaml +153 -0
- package/src/api/controllers/query/import/sources/tests/openapi3/data/petstore/petstore.json +1225 -0
- package/src/api/controllers/query/import/sources/tests/openapi3/data/petstore/petstore.yaml +804 -0
- package/src/api/controllers/query/import/sources/tests/openapi3/openapi3.spec.js +240 -0
- package/src/api/controllers/query/import/tests/index.spec.js +43 -0
- package/src/api/controllers/row/internal.js +5 -1
- package/src/api/routes/analytics.js +2 -2
- package/src/api/routes/table.js +1 -1
- package/src/api/routes/tests/misc.spec.js +2 -2
- package/src/automations/utils.js +5 -1
- package/src/definitions/datasource.ts +2 -5
- package/src/definitions/openapi.ts +480 -470
- package/src/environment.js +2 -0
- package/src/integrations/base/sql.ts +14 -9
- package/src/integrations/dynamodb.ts +3 -1
- package/src/integrations/firebase.ts +205 -0
- package/src/integrations/googlesheets.ts +16 -1
- package/src/integrations/index.ts +4 -1
- package/src/integrations/mysql.ts +15 -1
- package/src/integrations/rest.ts +2 -1
- package/src/integrations/tests/sql.spec.js +51 -0
- package/src/middleware/authorized.js +26 -6
- package/builder/assets/index.2dcb5072.js +0 -1291
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.0.2",
|
|
3
|
+
"info": {
|
|
4
|
+
"description": "A basic swagger file",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"title": "CRUD"
|
|
7
|
+
},
|
|
8
|
+
"servers": [
|
|
9
|
+
{
|
|
10
|
+
"url": "http://example.com"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"tags": [
|
|
14
|
+
{
|
|
15
|
+
"name": "entity"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"paths": {
|
|
19
|
+
"/entities": {
|
|
20
|
+
"post": {
|
|
21
|
+
"tags": [
|
|
22
|
+
"entity"
|
|
23
|
+
],
|
|
24
|
+
"operationId": "createEntity",
|
|
25
|
+
"requestBody": {
|
|
26
|
+
"content": {
|
|
27
|
+
"application/json": {
|
|
28
|
+
"schema": {
|
|
29
|
+
"$ref": "#/components/schemas/CreateEntity"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"responses": {
|
|
35
|
+
"200": {
|
|
36
|
+
"description": "successful operation",
|
|
37
|
+
"content": {
|
|
38
|
+
"application/json": {
|
|
39
|
+
"schema": {
|
|
40
|
+
"$ref": "#/components/schemas/Entity"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"get": {
|
|
48
|
+
"tags": [
|
|
49
|
+
"entity"
|
|
50
|
+
],
|
|
51
|
+
"operationId": "getEntities",
|
|
52
|
+
"parameters": [
|
|
53
|
+
{
|
|
54
|
+
"$ref": "#/components/parameters/PageParameter"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"$ref": "#/components/parameters/SizeParameter"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"responses": {
|
|
61
|
+
"200": {
|
|
62
|
+
"description": "successful operation",
|
|
63
|
+
"content": {
|
|
64
|
+
"application/json": {
|
|
65
|
+
"schema": {
|
|
66
|
+
"$ref": "#/components/schemas/Entities"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"/entities/{entityId}": {
|
|
75
|
+
"parameters": [
|
|
76
|
+
{
|
|
77
|
+
"$ref": "#/components/parameters/EntityIdParameter"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"get": {
|
|
81
|
+
"tags": [
|
|
82
|
+
"entity"
|
|
83
|
+
],
|
|
84
|
+
"operationId": "getEntity",
|
|
85
|
+
"responses": {
|
|
86
|
+
"200": {
|
|
87
|
+
"description": "successful operation",
|
|
88
|
+
"content": {
|
|
89
|
+
"application/json": {
|
|
90
|
+
"schema": {
|
|
91
|
+
"$ref": "#/components/schemas/Entity"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"put": {
|
|
99
|
+
"tags": [
|
|
100
|
+
"entity"
|
|
101
|
+
],
|
|
102
|
+
"operationId": "updateEntity",
|
|
103
|
+
"requestBody": {
|
|
104
|
+
"content": {
|
|
105
|
+
"application/json": {
|
|
106
|
+
"schema": {
|
|
107
|
+
"$ref": "#/components/schemas/Entity"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"responses": {
|
|
113
|
+
"200": {
|
|
114
|
+
"description": "successful operation",
|
|
115
|
+
"content": {
|
|
116
|
+
"application/json": {
|
|
117
|
+
"schema": {
|
|
118
|
+
"$ref": "#/components/schemas/Entity"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"patch": {
|
|
126
|
+
"tags": [
|
|
127
|
+
"entity"
|
|
128
|
+
],
|
|
129
|
+
"operationId": "patchEntity",
|
|
130
|
+
"requestBody": {
|
|
131
|
+
"content": {
|
|
132
|
+
"application/json": {
|
|
133
|
+
"schema": {
|
|
134
|
+
"$ref": "#/components/schemas/Entity"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"responses": {
|
|
140
|
+
"200": {
|
|
141
|
+
"description": "successful operation",
|
|
142
|
+
"content": {
|
|
143
|
+
"application/json": {
|
|
144
|
+
"schema": {
|
|
145
|
+
"$ref": "#/components/schemas/Entity"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"delete": {
|
|
153
|
+
"tags": [
|
|
154
|
+
"entity"
|
|
155
|
+
],
|
|
156
|
+
"parameters": [
|
|
157
|
+
{
|
|
158
|
+
"$ref": "#/components/parameters/APIKeyParameter"
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"operationId": "deleteEntity",
|
|
162
|
+
"responses": {
|
|
163
|
+
"204": {
|
|
164
|
+
"description": "successful operation"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"components": {
|
|
171
|
+
"parameters": {
|
|
172
|
+
"EntityIdParameter": {
|
|
173
|
+
"schema": {
|
|
174
|
+
"type": "integer",
|
|
175
|
+
"format": "int64"
|
|
176
|
+
},
|
|
177
|
+
"name": "entityId",
|
|
178
|
+
"in": "path",
|
|
179
|
+
"required": true
|
|
180
|
+
},
|
|
181
|
+
"PageParameter": {
|
|
182
|
+
"schema": {
|
|
183
|
+
"type": "integer",
|
|
184
|
+
"format": "int32"
|
|
185
|
+
},
|
|
186
|
+
"name": "page",
|
|
187
|
+
"in": "query",
|
|
188
|
+
"required": false
|
|
189
|
+
},
|
|
190
|
+
"SizeParameter": {
|
|
191
|
+
"schema": {
|
|
192
|
+
"type": "integer",
|
|
193
|
+
"format": "int32"
|
|
194
|
+
},
|
|
195
|
+
"name": "size",
|
|
196
|
+
"in": "query",
|
|
197
|
+
"required": false
|
|
198
|
+
},
|
|
199
|
+
"APIKeyParameter": {
|
|
200
|
+
"schema": {
|
|
201
|
+
"type": "string"
|
|
202
|
+
},
|
|
203
|
+
"name": "x-api-key",
|
|
204
|
+
"in": "header",
|
|
205
|
+
"required": false
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"schemas": {
|
|
209
|
+
"CreateEntity": {
|
|
210
|
+
"type": "object",
|
|
211
|
+
"properties": {
|
|
212
|
+
"name": {
|
|
213
|
+
"type": "string"
|
|
214
|
+
},
|
|
215
|
+
"type": {
|
|
216
|
+
"type": "string"
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"example": {
|
|
220
|
+
"name": "name",
|
|
221
|
+
"type": "type"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"Entity": {
|
|
225
|
+
"allOf": [
|
|
226
|
+
{
|
|
227
|
+
"type": "object",
|
|
228
|
+
"properties": {
|
|
229
|
+
"id": {
|
|
230
|
+
"type": "integer",
|
|
231
|
+
"format": "int64"
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"$ref": "#/components/schemas/CreateEntity"
|
|
237
|
+
}
|
|
238
|
+
],
|
|
239
|
+
"example": {
|
|
240
|
+
"id": 1,
|
|
241
|
+
"name": "name",
|
|
242
|
+
"type": "type"
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"Entities" : {
|
|
246
|
+
"type": "array",
|
|
247
|
+
"items": {
|
|
248
|
+
"$ref": "#/components/schemas/Entity"
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
openapi: 3.0.2
|
|
3
|
+
info:
|
|
4
|
+
description: A basic swagger file
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
title: CRUD
|
|
7
|
+
servers:
|
|
8
|
+
- url: http://example.com
|
|
9
|
+
tags:
|
|
10
|
+
- name: entity
|
|
11
|
+
paths:
|
|
12
|
+
"/entities":
|
|
13
|
+
post:
|
|
14
|
+
tags:
|
|
15
|
+
- entity
|
|
16
|
+
operationId: createEntity
|
|
17
|
+
requestBody:
|
|
18
|
+
content:
|
|
19
|
+
application/json:
|
|
20
|
+
schema:
|
|
21
|
+
"$ref": "#/components/schemas/CreateEntity"
|
|
22
|
+
responses:
|
|
23
|
+
'200':
|
|
24
|
+
description: successful operation
|
|
25
|
+
content:
|
|
26
|
+
application/json:
|
|
27
|
+
schema:
|
|
28
|
+
"$ref": "#/components/schemas/Entity"
|
|
29
|
+
get:
|
|
30
|
+
tags:
|
|
31
|
+
- entity
|
|
32
|
+
operationId: getEntities
|
|
33
|
+
parameters:
|
|
34
|
+
- "$ref": "#/components/parameters/PageParameter"
|
|
35
|
+
- "$ref": "#/components/parameters/SizeParameter"
|
|
36
|
+
responses:
|
|
37
|
+
'200':
|
|
38
|
+
description: successful operation
|
|
39
|
+
content:
|
|
40
|
+
application/json:
|
|
41
|
+
schema:
|
|
42
|
+
"$ref": "#/components/schemas/Entities"
|
|
43
|
+
"/entities/{entityId}":
|
|
44
|
+
parameters:
|
|
45
|
+
- "$ref": "#/components/parameters/EntityIdParameter"
|
|
46
|
+
get:
|
|
47
|
+
tags:
|
|
48
|
+
- entity
|
|
49
|
+
operationId: getEntity
|
|
50
|
+
responses:
|
|
51
|
+
'200':
|
|
52
|
+
description: successful operation
|
|
53
|
+
content:
|
|
54
|
+
application/json:
|
|
55
|
+
schema:
|
|
56
|
+
"$ref": "#/components/schemas/Entity"
|
|
57
|
+
put:
|
|
58
|
+
tags:
|
|
59
|
+
- entity
|
|
60
|
+
operationId: updateEntity
|
|
61
|
+
requestBody:
|
|
62
|
+
content:
|
|
63
|
+
application/json:
|
|
64
|
+
schema:
|
|
65
|
+
"$ref": "#/components/schemas/Entity"
|
|
66
|
+
responses:
|
|
67
|
+
'200':
|
|
68
|
+
description: successful operation
|
|
69
|
+
content:
|
|
70
|
+
application/json:
|
|
71
|
+
schema:
|
|
72
|
+
"$ref": "#/components/schemas/Entity"
|
|
73
|
+
patch:
|
|
74
|
+
tags:
|
|
75
|
+
- entity
|
|
76
|
+
operationId: patchEntity
|
|
77
|
+
requestBody:
|
|
78
|
+
content:
|
|
79
|
+
application/json:
|
|
80
|
+
schema:
|
|
81
|
+
"$ref": "#/components/schemas/Entity"
|
|
82
|
+
responses:
|
|
83
|
+
'200':
|
|
84
|
+
description: successful operation
|
|
85
|
+
content:
|
|
86
|
+
application/json:
|
|
87
|
+
schema:
|
|
88
|
+
"$ref": "#/components/schemas/Entity"
|
|
89
|
+
delete:
|
|
90
|
+
tags:
|
|
91
|
+
- entity
|
|
92
|
+
parameters:
|
|
93
|
+
- "$ref": "#/components/parameters/APIKeyParameter"
|
|
94
|
+
operationId: deleteEntity
|
|
95
|
+
responses:
|
|
96
|
+
'204':
|
|
97
|
+
description: successful operation
|
|
98
|
+
components:
|
|
99
|
+
parameters:
|
|
100
|
+
EntityIdParameter:
|
|
101
|
+
schema:
|
|
102
|
+
type: integer
|
|
103
|
+
format: int64
|
|
104
|
+
name: entityId
|
|
105
|
+
in: path
|
|
106
|
+
required: true
|
|
107
|
+
PageParameter:
|
|
108
|
+
schema:
|
|
109
|
+
type: integer
|
|
110
|
+
format: int32
|
|
111
|
+
name: page
|
|
112
|
+
in: query
|
|
113
|
+
required: false
|
|
114
|
+
SizeParameter:
|
|
115
|
+
schema:
|
|
116
|
+
type: integer
|
|
117
|
+
format: int32
|
|
118
|
+
name: size
|
|
119
|
+
in: query
|
|
120
|
+
required: false
|
|
121
|
+
APIKeyParameter:
|
|
122
|
+
schema:
|
|
123
|
+
type: string
|
|
124
|
+
name: x-api-key
|
|
125
|
+
in: header
|
|
126
|
+
required: false
|
|
127
|
+
schemas:
|
|
128
|
+
CreateEntity:
|
|
129
|
+
type: object
|
|
130
|
+
properties:
|
|
131
|
+
name:
|
|
132
|
+
type: string
|
|
133
|
+
type:
|
|
134
|
+
type: string
|
|
135
|
+
example:
|
|
136
|
+
name: name
|
|
137
|
+
type: type
|
|
138
|
+
Entity:
|
|
139
|
+
allOf:
|
|
140
|
+
- type: object
|
|
141
|
+
properties:
|
|
142
|
+
id:
|
|
143
|
+
type: integer
|
|
144
|
+
format: int64
|
|
145
|
+
- "$ref": "#/components/schemas/CreateEntity"
|
|
146
|
+
example:
|
|
147
|
+
id: 1
|
|
148
|
+
name: name
|
|
149
|
+
type: type
|
|
150
|
+
Entities:
|
|
151
|
+
type: array
|
|
152
|
+
items:
|
|
153
|
+
"$ref": "#/components/schemas/Entity"
|