massakam commented on a change in pull request #10790:
URL: https://github.com/apache/pulsar/pull/10790#discussion_r644513191



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
##########
@@ -4035,4 +4035,126 @@ protected void internalTruncateTopic(AsyncResponse 
asyncResponse, boolean author
             });
         }
     }
+
+    protected void internalSetReplicatedSubscriptionStatus(AsyncResponse 
asyncResponse, String subName,
+            boolean authoritative, Boolean enabled) {
+        log.info("[{}] Attempting to change replicated subscription status to 
{} - {} {}", clientAppId(), enabled,
+                topicName, subName);
+
+        if (enabled == null) {

Review comment:
       `enabled` can be null if the request body is empty.
   ```sh
   $ curl -i \
     -X POST \
     -d '' \
     -H 'Content-Type: application/json' \
     
http://localhost:8080/admin/v2/persistent/public/default/massakam/subscription/sub/replicatedSubscriptionStatus
   
   HTTP/1.1 400 Bad Request
   Date: Thu, 03 Jun 2021 06:04:10 GMT
   broker-address: localhost
   Content-Type: application/json
   Content-Length: 50
   Server: Jetty(9.4.39.v20210325)
   
   {"reason":"Boolean type request body is required"}
   ```
   I think the "required = true" specification is just an option used when 
generating Swagger documentation.
   
https://docs.swagger.io/swagger-core/v1.5.0/apidocs/io/swagger/annotations/ApiParam.html




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to