This is an automated email from the ASF dual-hosted git repository.
rexxiong pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/celeborn.git
The following commit(s) were added to refs/heads/main by this push:
new f1b71e3eb [CELEBORN-1436][FOLLOWUP] Add swagger editor links for
RESTful spec
f1b71e3eb is described below
commit f1b71e3eb7caa0c25b0829af9ddc719fe6312c96
Author: Wang, Fei <[email protected]>
AuthorDate: Mon Apr 21 15:28:52 2025 +0800
[CELEBORN-1436][FOLLOWUP] Add swagger editor links for RESTful spec
### What changes were proposed in this pull request?
Add swagger editor links for RESTful spec.
Fix warn in the spec:
Master spec:

Worker spec:

### Why are the changes needed?
To view the spec online.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
<img width="1103" alt="image"
src="https://github.com/user-attachments/assets/0118e47d-da2d-43c8-a41d-085cde2ed06f"
/>
No warn now, see:
https://editor-next.swagger.io/?url=https://raw.githubusercontent.com/turbofei/incubator-celeborn/openapi/openapi/openapi-client/src/main/openapi3/master_rest_v1.yaml
https://editor-next.swagger.io/?url=https://raw.githubusercontent.com/turbofei/incubator-celeborn/openapi/openapi/openapi-client/src/main/openapi3/worker_rest_v1.yaml
Closes #3200 from turboFei/openapi.
Authored-by: Wang, Fei <[email protected]>
Signed-off-by: Shuang <[email protected]>
---
docs/restapi.md | 8 ++------
.../service/deploy/master/http/api/v1/ApplicationResource.scala | 3 ++-
.../java/org/apache/celeborn/rest/v1/master/ApplicationApi.java | 4 ++--
openapi/openapi-client/src/main/openapi3/master_rest_v1.yaml | 4 +++-
openapi/openapi-client/src/main/openapi3/worker_rest_v1.yaml | 2 --
5 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/docs/restapi.md b/docs/restapi.md
index 47f29295c..4f2892aec 100644
--- a/docs/restapi.md
+++ b/docs/restapi.md
@@ -85,12 +85,8 @@ See the [migration guide](migration.md) for API mappings.
#### Master
-See the master openapi spec yaml in the repo
`openapi/openapi-client/src/main/openapi3/master_rest_v1.yaml`.
+See the master openapi spec yaml in the repo
`openapi/openapi-client/src/main/openapi3/master_rest_v1.yaml`, or use the
[Swagger
Editor](https://editor-next.swagger.io/?url=https://raw.githubusercontent.com/apache/celeborn/main/openapi/openapi-client/src/main/openapi3/master_rest_v1.yaml)
online for visualization.
#### Worker
-See the worker openapi spec yaml in the repo
`openapi/openapi-client/src/main/openapi3/worker_rest_v1.yaml`.
-
-**Note:**
-
-You can locally preview the OpenAPI specification YAML file in IDE, or use the
[Swagger Editor](https://editor.swagger.io/) online for visualization.
+See the worker openapi spec yaml in the repo
`openapi/openapi-client/src/main/openapi3/worker_rest_v1.yaml`, or use the
[Swagger
Editor](https://editor-next.swagger.io/?url=https://raw.githubusercontent.com/apache/celeborn/main/openapi/openapi-client/src/main/openapi3/worker_rest_v1.yaml)
online for visualization.
diff --git
a/master/src/main/scala/org/apache/celeborn/service/deploy/master/http/api/v1/ApplicationResource.scala
b/master/src/main/scala/org/apache/celeborn/service/deploy/master/http/api/v1/ApplicationResource.scala
index 27d2efa0f..f34e79159 100644
---
a/master/src/main/scala/org/apache/celeborn/service/deploy/master/http/api/v1/ApplicationResource.scala
+++
b/master/src/main/scala/org/apache/celeborn/service/deploy/master/http/api/v1/ApplicationResource.scala
@@ -60,7 +60,8 @@ class ApplicationResource extends ApiRequestContext {
content = Array(new Content(
mediaType = MediaType.APPLICATION_JSON,
schema = new Schema(implementation = classOf[HandleResponse]))))
- @DELETE
+ @POST
+ @Path("/delete_apps")
def deleteApps(request: DeleteAppsRequest): HandleResponse = {
val apps = request.getApps.asScala
apps.foreach(app => statusSystem.deleteApp(app))
diff --git
a/openapi/openapi-client/src/main/java/org/apache/celeborn/rest/v1/master/ApplicationApi.java
b/openapi/openapi-client/src/main/java/org/apache/celeborn/rest/v1/master/ApplicationApi.java
index 143610b21..47ecf36d1 100644
---
a/openapi/openapi-client/src/main/java/org/apache/celeborn/rest/v1/master/ApplicationApi.java
+++
b/openapi/openapi-client/src/main/java/org/apache/celeborn/rest/v1/master/ApplicationApi.java
@@ -74,7 +74,7 @@ public class ApplicationApi extends BaseApi {
Object localVarPostBody = deleteAppsRequest;
// create path and map variables
- String localVarPath = "/api/v1/applications";
+ String localVarPath = "/api/v1/applications/delete_apps";
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
String localVarQueryParameterBaseName;
@@ -104,7 +104,7 @@ public class ApplicationApi extends BaseApi {
TypeReference<HandleResponse> localVarReturnType = new
TypeReference<HandleResponse>() {};
return apiClient.invokeAPI(
localVarPath,
- "DELETE",
+ "POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarQueryStringJoiner.toString(),
diff --git a/openapi/openapi-client/src/main/openapi3/master_rest_v1.yaml
b/openapi/openapi-client/src/main/openapi3/master_rest_v1.yaml
index 6d88e5b1c..44a96f6b7 100644
--- a/openapi/openapi-client/src/main/openapi3/master_rest_v1.yaml
+++ b/openapi/openapi-client/src/main/openapi3/master_rest_v1.yaml
@@ -253,7 +253,9 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ApplicationsHeartbeatResponse'
- delete:
+
+ /api/v1/applications/delete_apps:
+ post:
tags:
- Application
operationId: deleteApps
diff --git a/openapi/openapi-client/src/main/openapi3/worker_rest_v1.yaml
b/openapi/openapi-client/src/main/openapi3/worker_rest_v1.yaml
index 2e1d5c543..8ef32fb9c 100644
--- a/openapi/openapi-client/src/main/openapi3/worker_rest_v1.yaml
+++ b/openapi/openapi-client/src/main/openapi3/worker_rest_v1.yaml
@@ -652,10 +652,8 @@ components:
properties:
primaryPartitions:
$ref: '#/components/schemas/ShufflePartitionLocations'
- default: { }
replicaPartitions:
$ref: '#/components/schemas/ShufflePartitionLocations'
- default: { }
WorkerId:
type: object