MasterKenway opened a new issue #240:
URL: https://github.com/apache/dubbo-go-pixiu/issues/240


   <!-- Please use this template while reporting a bug and provide as much info 
as possible. Not doing so may result in your bug not being addressed in a 
timely manner. Thanks!
   
   -->
   
   
   **What happened**:
   Request for a none params integration request which is on dubbo protocol 
failed
   **What you expected to happen**:
   fix it
   **How to reproduce it (as minimally and precisely as possible)**:
   
   In `samples/dubbogo/simple/query/`
   
   add below function  for `userDB`
   ```
   func (db *userDB) GetAllUsers() ([]*User, error) {
        var users []*User //nolint:prealloc
        if len(db.nameIndex) == 0 {
                return users, errors.New("no users")
        }
   
        for _, user := range db.nameIndex {
                users = append(users, user)
        }
        return users, nil
   }
   ```
   
   add below function for `UserProvider`
   ```
   func (u *UserProvider) GetAllUsers(_ context.Context) ([]*User, error) {
        return cache.GetAllUsers()
   }
   ```
   
   add below config for `pixiu/api_config.yml`
   ```
     - path: '/api/v1/test-dubbo/user/get-all'
       type: restful
       description: user
       methods:
         - httpVerb: GET
           onAir: true
           timeout: 1000ms
           inboundRequest:
             requestType: http
           integrationRequest:
             requestType: http
             host: 127.0.0.1:8889
             path: /UserProvider/GetAllUsers
             group: "test"
             version: 1.0.0
   ```
   
   this example will lead to null pointer panic
   
   **Anything else we need to know?**:
   


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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to