tomjo opened a new issue, #1105:
URL: https://github.com/apache/pulsar-client-go/issues/1105

   #### Expected behavior
   
   Client.Namespaces().SetTopicAutoCreation() allows setting a 
TopicAutoCreation _allowed_ policy on the namespace with default topic type 
_non-partitioned_.
   
   #### Actual behavior
   
   SetTopicAutoCreation has a parameter utils.TopicAutoCreationConfig, this 
struct has an int field Partitions (defaultNumPartitions) which cannot be nil. 
When trying to SetTopicAutoCreation with config 
(Allow=true,Type="non-partitioned",Partitions=0) the API call will fail with: 
   
   `{"reason":"Invalid configuration for autoTopicCreationOverride. the detail 
is [defaultNumPartitions] is not allowed to be set when the type is 
non-partition."}`
   
   This happens with any value for Partitions. In the pulsar admin rest-api the 
defaultNumPartitions field is optional, it should either be made optional as 
well in TopicAutoCreationConfig or the library should not include the field 
when Type="non-partitioned".
   
   With the rest API I can do:
   `
   curl --data '{"allowAutoTopicCreation":true,"topicType":"non-partitioned"}' 
--header "Content-Type: application/json" --header "Accept: application/json" 
$APIHOST/admin/v2/namespaces/$tenant/$namespace/autoTopicCreation`
   
   #### Steps to reproduce
   
   Call Client.Namespaces().SetTopicAutoCreation() with a TopicAutoCreation 
with Allow=true and Type="non-partitioned"
   
   #### System configuration
   **Pulsar version**: 2.11.2
   


-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to