Skip to content

Commit 5a564d0

Browse files
authored
fix: rest docs wording & change command POST endpoint (#1271)
### Motivation Docs did not say correct method/endpoints ### Modification Fix docs wording & added node command endpoint to be the same as docs ### Result Now docs properly explains what it does and how to use it. ### Fixes Fixes #1270
1 parent 3c10d5b commit 5a564d0

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

modules/rest/src/main/java/eu/cloudnetservice/modules/rest/v2/V2HttpHandlerCluster.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private void handleNodeRequest(@NonNull HttpContext context, @NonNull @RequestPa
8282
}
8383

8484
@BearerAuth
85-
@HttpRequestHandler(paths = "/api/v2/cluster/{node}", methods = "POST")
85+
@HttpRequestHandler(paths = "/api/v2/cluster/{node}/command", methods = "POST")
8686
private void handleNodeCommandRequest(
8787
@NonNull HttpContext context,
8888
@NonNull @RequestPathParam("node") String node,

modules/rest/src/main/resources/documentation/swagger.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,7 +1578,7 @@
15781578
"post" : {
15791579
"requestBody" : {
15801580
"required" : true,
1581-
"description" : "The task to create",
1581+
"description" : "The task to create or edit",
15821582
"content" : {
15831583
"application/json" : {
15841584
"schema" : {
@@ -1588,10 +1588,10 @@
15881588
}
15891589
},
15901590
"tags" : [ "Tasks" ],
1591-
"summary" : "Creates a task",
1591+
"summary" : "Create or edit a task",
15921592
"responses" : {
15931593
"200" : {
1594-
"description" : "The request was ok but the task couldn't be created",
1594+
"description" : "The request was ok but the task couldn't be created / edited",
15951595
"content" : {
15961596
"application/json" : {
15971597
"schema" : {
@@ -1607,7 +1607,7 @@
16071607
}
16081608
},
16091609
"201" : {
1610-
"description" : "The task was created successfully",
1610+
"description" : "The task was created / edited successfully",
16111611
"content" : {
16121612
"application/json" : {
16131613
"schema" : {
@@ -4008,6 +4008,13 @@
40084008
"type" : "string"
40094009
},
40104010
"example" : [ "spigot.jar", "plugins/cool.jar" ]
4011+
},
4012+
"includes" : {
4013+
"type" : "array",
4014+
"items" : {
4015+
"type" : "string"
4016+
},
4017+
"example" : [ "spigot.jar", "plugins/cool.jar" ]
40114018
}
40124019
}
40134020
} ]

0 commit comments

Comments
 (0)