Skip to content

Commit 599588c

Browse files
committed
chore: ui dev handler swagger
1 parent 4cc07b7 commit 599588c

4 files changed

Lines changed: 64 additions & 2 deletions

File tree

docs/docs.go

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,16 @@ const docTemplate = `{
167167
"daemon"
168168
],
169169
"operationId": "enableDev",
170+
"parameters": [
171+
{
172+
"description": "Optional commands to run on file changes",
173+
"name": "body",
174+
"in": "body",
175+
"schema": {
176+
"$ref": "#/definitions/handler.DevModeBody"
177+
}
178+
}
179+
],
170180
"responses": {
171181
"200": {
172182
"description": "OK",
@@ -1076,7 +1086,9 @@ const docTemplate = `{
10761086
],
10771087
"x-enum-comments": {
10781088
"RunModeAlways": "default",
1079-
"RunModePersistent": "restarts on failure and on program restart"
1089+
"RunModeOnce": "runs only once",
1090+
"RunModePersistent": "restarts on failure and on program restart",
1091+
"RunModeRestart": "restarts on failure"
10801092
},
10811093
"x-enum-varnames": [
10821094
"RunModeAlways",
@@ -1100,6 +1112,17 @@ const docTemplate = `{
11001112
"ScrollLockStatusWaiting"
11011113
]
11021114
},
1115+
"handler.DevModeBody": {
1116+
"type": "object",
1117+
"properties": {
1118+
"commands": {
1119+
"type": "object",
1120+
"additionalProperties": {
1121+
"$ref": "#/definitions/CommandInstructionSet"
1122+
}
1123+
}
1124+
}
1125+
},
11031126
"handler.HealhResponse": {
11041127
"type": "object",
11051128
"properties": {

docs/swagger.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,16 @@
159159
"daemon"
160160
],
161161
"operationId": "enableDev",
162+
"parameters": [
163+
{
164+
"description": "Optional commands to run on file changes",
165+
"name": "body",
166+
"in": "body",
167+
"schema": {
168+
"$ref": "#/definitions/handler.DevModeBody"
169+
}
170+
}
171+
],
162172
"responses": {
163173
"200": {
164174
"description": "OK",
@@ -1068,7 +1078,9 @@
10681078
],
10691079
"x-enum-comments": {
10701080
"RunModeAlways": "default",
1071-
"RunModePersistent": "restarts on failure and on program restart"
1081+
"RunModeOnce": "runs only once",
1082+
"RunModePersistent": "restarts on failure and on program restart",
1083+
"RunModeRestart": "restarts on failure"
10721084
},
10731085
"x-enum-varnames": [
10741086
"RunModeAlways",
@@ -1092,6 +1104,17 @@
10921104
"ScrollLockStatusWaiting"
10931105
]
10941106
},
1107+
"handler.DevModeBody": {
1108+
"type": "object",
1109+
"properties": {
1110+
"commands": {
1111+
"type": "object",
1112+
"additionalProperties": {
1113+
"$ref": "#/definitions/CommandInstructionSet"
1114+
}
1115+
}
1116+
}
1117+
},
10951118
"handler.HealhResponse": {
10961119
"type": "object",
10971120
"properties": {

docs/swagger.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ definitions:
285285
type: string
286286
x-enum-comments:
287287
RunModeAlways: default
288+
RunModeOnce: runs only once
288289
RunModePersistent: restarts on failure and on program restart
290+
RunModeRestart: restarts on failure
289291
x-enum-varnames:
290292
- RunModeAlways
291293
- RunModeOnce
@@ -303,6 +305,13 @@ definitions:
303305
- ScrollLockStatusDone
304306
- ScrollLockStatusError
305307
- ScrollLockStatusWaiting
308+
handler.DevModeBody:
309+
properties:
310+
commands:
311+
additionalProperties:
312+
$ref: '#/definitions/CommandInstructionSet'
313+
type: object
314+
type: object
306315
handler.HealhResponse:
307316
properties:
308317
mode:
@@ -442,6 +451,12 @@ paths:
442451
consumes:
443452
- application/json
444453
operationId: enableDev
454+
parameters:
455+
- description: Optional commands to run on file changes
456+
in: body
457+
name: body
458+
schema:
459+
$ref: '#/definitions/handler.DevModeBody'
445460
produces:
446461
- application/json
447462
responses:

internal/handler/ui_dev_handler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ func NewUiDevHandler(uiDevService ports.UiDevServiceInterface, scrollService por
5050
// @Tags ui, dev, druid, daemon
5151
// @Accept json
5252
// @Produce json
53+
// @Param body body DevModeBody false "Optional commands to run on file changes"
5354
// @Success 200 {object} DevModeResponse
5455
// @Failure 500 {object} ErrorResponse
5556
// @Router /api/v1/dev/enable [post]

0 commit comments

Comments
 (0)