You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/27 10:56:18 UTC

[GitHub] [apisix-dashboard] nic-chen opened a new issue #896: bug: manager api does not support int for field `id`

nic-chen opened a new issue #896:
URL: https://github.com/apache/apisix-dashboard/issues/896


   # Bug report
   
   ## Describe the bug
   
   `admin api` supports the id field as string and int type, `manager api` only supports string, 
   which will cause the data with int type id entered in `admin api` cannot be displayed with `manager api`
   
   ## How to Reproduce
   
   1.  create upstream
   ```sh
   curl "http://127.0.0.1:9080/apisix/admin/upstreams/60" -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -i -X PUT -d '
   {
       "type": "roundrobin",
   	"name":"cmd-test",
   	"desc":"cmd-test-desc",
       "nodes": {
           "127.0.0.1:58080": 1
       }
   }'
   ```
   
   2. use upstream  id as int
   ```
   curl "http://127.0.0.1:9080/apisix/admin/routes/6" -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "uri": "/*",
   	"name":"route test",
   	"desc":"hello route",
       "host": "127.0.0.1",    
       "upstream_id": 60
   }'
   ```
   
   


----------------------------------------------------------------
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] [apisix-dashboard] nic-chen closed issue #896: bug: manager api does not support int for field `id`

Posted by GitBox <gi...@apache.org>.
nic-chen closed issue #896:
URL: https://github.com/apache/apisix-dashboard/issues/896


   


----------------------------------------------------------------
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] [apisix-dashboard] gxthrj commented on issue #896: bug: manager api does not support int for field `id`

Posted by GitBox <gi...@apache.org>.
gxthrj commented on issue #896:
URL: https://github.com/apache/apisix-dashboard/issues/896#issuecomment-735344134


   > In order to fix this bug quickly, I am going to change the ID field type to interface, perform type conversion during input, and convert int to a string so that when APISIX discards int as an id, it can be directly replaced.
   > 
   > I also refer to the [IntOrString](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr.go#L40) used in k8s, similar structure is too complicated for us, both input and output need to be processed accordingly, and it is inconvenient to replace all of them with string in the future.
   > 
   > What do you think?
   > 
   > @spacewander @ShiningRush @tokers @gxthrj @membphis @moonming
   
   Agree


----------------------------------------------------------------
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] [apisix-dashboard] membphis commented on issue #896: bug: manager api does not support int for field `id`

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #896:
URL: https://github.com/apache/apisix-dashboard/issues/896#issuecomment-735017771


   We can choose a quick way at the first.
   
   This is acceptable for me.


----------------------------------------------------------------
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] [apisix-dashboard] moonming commented on issue #896: bug: manager api does not support int for field `id`

Posted by GitBox <gi...@apache.org>.
moonming commented on issue #896:
URL: https://github.com/apache/apisix-dashboard/issues/896#issuecomment-734795008


   I think this is a serious bug


----------------------------------------------------------------
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] [apisix-dashboard] nic-chen commented on issue #896: bug: manager api does not support int for field `id`

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #896:
URL: https://github.com/apache/apisix-dashboard/issues/896#issuecomment-734902007


   In order to fix this bug quickly, I am going to change the ID field type to interface, perform type conversion during input, and convert int to a string so that when APISIX discards int as an id, it can be directly replaced.
   
   I also refer to the [IntOrString](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr.go#L40) used in k8s, similar structure is too complicated for us, both input and output need to be processed accordingly, and it is inconvenient to replace all of them with string in the future.
   
   What do you think?
   
   @spacewander @ShiningRush @tokers @gxthrj @membphis @moonming 
   
   


----------------------------------------------------------------
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] [apisix-dashboard] membphis commented on issue #896: bug: manager api does not support int for field `id`

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #896:
URL: https://github.com/apache/apisix-dashboard/issues/896#issuecomment-734783445


   thid bug still not fixed?


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