Apisix-dashboard: Bug: the row field is nil when request to get the label list

Created on 10 Apr 2021  路  2Comments  路  Source: apache/apisix-dashboard

Issue description

Hello, I find that when we do the request GET /apisix/admin/labels/route the result is
like

{"code":0,"message":"","data":{"rows":null,"total_size":0},"request_id":"74476a59-a466-4c77-8d6c-18cea6560df6"}

Expected behavior

The row field is nil.
It should be [].

How to Reproduce

  1. Request to get the auth token
curl http://127.0.0.1:9000/apisix/admin/user/login -X POST -d '{"username":"admin", "password": "admin"}' -H "Content-Type: application/json"
  1. Use the token to get the lable list
curl localhost:9000/apisix/admin/labels/route -H "Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MTgwNTI5MDMsImlhdCI6MTYxODA0OTMwMywic3ViIjoiYWRtaW4ifQ.N45AjXd9ECp7wjOgK6FZR39eIbXpjofx8ji0qT5OoEE"

The result is

{"code":0,"message":"","data":{"rows":null,"total_size":0},"request_id":"6d90a12c-4091-46ae-b273-1c3675435696"}

Screenshots

Environment

  • apisix version (cmd: apisix version):
  • OS (cmd: uname -a):
  • OpenResty / Nginx version (cmd: nginx -V or openresty -V):
  • etcd version, if have (cmd: run curl http://127.0.0.1:9090/v1/server_info to get the info from server-info API):
  • apisix-dashboard version, if have: master branch
  • Browser version, if have:

Additional context

Add we need to check the row field in all modules.

backend bug

Most helpful comment

Hey @starsz, I have made the fix. Feel free to check it out :)

All 2 comments

Hey @starsz, I have made the fix. Feel free to check it out :)

Hey @starsz, I have made the fix. Feel free to check it out :)

Yeah.Thanks!

Was this page helpful?
0 / 5 - 0 ratings