You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/07/22 08:16:37 UTC

[GitHub] [pulsar] BewareMyPower opened a new issue #7625: [docs] request body description of sinks REST APIs is wrong

BewareMyPower opened a new issue #7625:
URL: https://github.com/apache/pulsar/issues/7625


   See: https://pulsar.apache.org/sink-rest-api/?version=2.6.0#operation/registerSink
   
   The doc of request body is 
   
   > A JSON value presenting config payload of a Pulsar Sink. All available configuration options are:
   
   And the request sample is:
   
   ```json
   {  
   	"classname": "org.example.MySinkTest",
   	"inputs": ["persistent://public/default/sink-input"],
   	"processingGuarantees": "EFFECTIVELY_ONCE",
   	"parallelism": 10
   }
   ```
   
   But if I changed the header to `Content-Type: application/json` and passed a JSON body, then a 415 response would be received.
   
   From the [source code](https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SinksBase.java#L71):
   
   ```java
       @Path("/{tenant}/{namespace}/{sinkName}")
       @Consumes(MediaType.MULTIPART_FORM_DATA)
       public void registerSink
   ```
   
   the media type is `multipart/form-data`, and the body contains two parts. The JSON presentation of a `SinkConfig` object is just one part, the other part should be the octet stream of a NAR file or an url of package.
   
   The same goes for `updateSink` REST API.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] jiazhai commented on issue #7625: [docs] request body description of sinks REST APIs is wrong

Posted by GitBox <gi...@apache.org>.
jiazhai commented on issue #7625:
URL: https://github.com/apache/pulsar/issues/7625#issuecomment-662824674


   From my view,  `ApiParam` should be workable. 
   @tuteng @Jennifer88huang Would you please help provide more instructions or examples for @BewareMyPower to reference on this doc fix? It would be better to provide an easy way to verify it. 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] Jennifer88huang commented on issue #7625: [docs] request body description of sinks REST APIs is wrong

Posted by GitBox <gi...@apache.org>.
Jennifer88huang commented on issue #7625:
URL: https://github.com/apache/pulsar/issues/7625#issuecomment-670385802


   @jiazhai got it.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] jiazhai commented on issue #7625: [docs] request body description of sinks REST APIs is wrong

Posted by GitBox <gi...@apache.org>.
jiazhai commented on issue #7625:
URL: https://github.com/apache/pulsar/issues/7625#issuecomment-662781895


   Thanks @BewareMyPower . Would you like to help contribute a fix for this issue?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] BewareMyPower commented on issue #7625: [docs] request body description of sinks REST APIs is wrong

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on issue #7625:
URL: https://github.com/apache/pulsar/issues/7625#issuecomment-662798336


   This part of doc seems to be generated by Java annotations, eg. `A JSON value presenting config payload of a Pulsar Sink` is from `@ApiParam` before the following line:
   
   ```java
   final @FormDataParam("sinkConfig") SinkConfig sinkConfig
   ```
   
   The above three `@FormDataParam` fields don't have associated `@ApiParam`s. I'm not familiar with JavaDoc, would the addition of `@ApiParam` work? @jiazhai 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] srijeyanthan-cerexio commented on issue #7625: [docs] request body description of sinks REST APIs is wrong

Posted by GitBox <gi...@apache.org>.
srijeyanthan-cerexio commented on issue #7625:
URL: https://github.com/apache/pulsar/issues/7625#issuecomment-750759318


   Any update on this issue?


----------------------------------------------------------------
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:
users@infra.apache.org