wenhaoZhao1997 commented on issue #11440:
URL: https://github.com/apache/apisix/issues/11440#issuecomment-2257382636

   > @wenhaoZhao1997
   > 
   > May be there is a quick workaround: (mainly to prevent ambiguity of JSON 
object/array for the frontend)
   > 
   > 1. set `no_default_values` pb_option of the plugin
   >    
https://apisix.apache.org/docs/apisix/plugins/grpc-transcode/#options-for-pb_option
   >    with the option, the empty array field would be presented like this:
   >    ```json
   >    {
   >        "items": {}
   >    }
   >    ```
   >    
   >    
   >        
   >          
   >        
   >    
   >          
   >        
   >    
   >        
   >      
   >    --->
   >    ```
   >    {}
   >    ```
   >    
   >    
   >        
   >          
   >        
   >    
   >          
   >        
   >    
   >        
   >      
   >    see also: 
https://github.com/starwing/lua-protobuf?tab=readme-ov-file#options
   >    auto_default_values(default) - act as `use_default_values` for `proto3` 
and act as `no_default_values` for the others
   > 2. at the frontend, test the `items` field if `undefined` or not
   
   thx for your reply,  yes i have tried pb_option no_default_values , and its 
indeed a solution.
   and i want to know wheather its a plugin lua code problem (when decoding 
proto file)or smth.
   if its a bug ,why didn't anyone else find out before.


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