This is an automated email from the ASF dual-hosted git repository.

SteNicholas 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 c0cad1926d [CELEBORN-2404] Fix required field typo in 
SendWorkerEventRequest schema
c0cad1926d is described below

commit c0cad1926d4b3ef6d56b277b01dd6351cc5e894f
Author: yew1eb <[email protected]>
AuthorDate: Thu Aug 6 13:29:09 2026 +0800

    [CELEBORN-2404] Fix required field typo in SendWorkerEventRequest schema
    
    ### What changes were proposed in this pull request?
    
    Fix a typo in `master_rest_v1.yaml`: the `SendWorkerEventRequest` schema 
declared `worker` in its `required` list, but the actual property name is 
`workers`.
    
    ### Why are the changes needed?
    
    The openapi-generator silently ignores the non-existent `worker` field, so 
the generated client compiles fine, but the spec declares a required field that 
does not exist and Swagger UI misleadingly shows `worker` as required. The 
server side validates `request.getWorkers.isEmpty`, consistent with the 
`workers` property.
    
    ### Does this PR resolve a correctness bug?
    
    - [ ] Yes
    
    ### Does this PR introduce _any_ user-facing change?
    
    - [ ] Yes
    
    ### How was this patch tested?
    
    - Regenerated the openapi client (`./build/mvn clean generate-sources -pl 
openapi/openapi-client`): no diff in generated code, as the generator does not 
emit anything for `required`.
    - The module builds successfully, which also validates the YAML syntax.
    
    Closes #3783 from yew1eb/fix-send-worker-event-request-required.
    
    Authored-by: yew1eb <[email protected]>
    Signed-off-by: Nicholas Jiang <[email protected]>
---
 .../org/apache/celeborn/rest/v1/model/SendWorkerEventRequest.java   | 6 +++---
 openapi/openapi-client/src/main/openapi3/master_rest_v1.yaml        | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/openapi/openapi-client/src/main/java/org/apache/celeborn/rest/v1/model/SendWorkerEventRequest.java
 
b/openapi/openapi-client/src/main/java/org/apache/celeborn/rest/v1/model/SendWorkerEventRequest.java
index c977c14783..eb02a4dd6f 100644
--- 
a/openapi/openapi-client/src/main/java/org/apache/celeborn/rest/v1/model/SendWorkerEventRequest.java
+++ 
b/openapi/openapi-client/src/main/java/org/apache/celeborn/rest/v1/model/SendWorkerEventRequest.java
@@ -136,9 +136,9 @@ public class SendWorkerEventRequest {
    * The workers to send the event.
    * @return workers
    */
-  @javax.annotation.Nullable
+  @javax.annotation.Nonnull
   @JsonProperty(JSON_PROPERTY_WORKERS)
-  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+  @JsonInclude(value = JsonInclude.Include.ALWAYS)
 
   public List<WorkerId> getWorkers() {
     return workers;
@@ -146,7 +146,7 @@ public class SendWorkerEventRequest {
 
 
   @JsonProperty(JSON_PROPERTY_WORKERS)
-  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+  @JsonInclude(value = JsonInclude.Include.ALWAYS)
   public void setWorkers(List<WorkerId> workers) {
     this.workers = workers;
   }
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 c76b5f0cfc..72e8a4e821 100644
--- a/openapi/openapi-client/src/main/openapi3/master_rest_v1.yaml
+++ b/openapi/openapi-client/src/main/openapi3/master_rest_v1.yaml
@@ -1301,7 +1301,7 @@ components:
             $ref: '#/components/schemas/WorkerId'
       required:
         - eventType
-        - worker
+        - workers
 
     RatisElectionTransferRequest:
       type: object

Reply via email to