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/10/21 00:14:30 UTC

[GitHub] [apisix] imjoey commented on issue #2479: bug: route name should be unique, but now it can be duplicate

imjoey commented on issue #2479:
URL: https://github.com/apache/apisix/issues/2479#issuecomment-713211974


   > the Key point is that the response data did not contain id value, so the route created by post cannot be updated,Or there are other ways to update this data ,which are not mentioned in the documentation :)
   
   Hi @liuxiran , actually there is a field `{"node":{"key":"\/apisix\/routes\/00000000000000000106"}` within response in your example, and the `00000000000000000106` is indeed the `id` of route. When we are using `POST` method to create a route, the `id` is automatically set to the latest `version` of the etcd by APISIX, which is a global counter incremented every time the data in etcd modified.
   
   > you used the `PUT` method, so it will update the exist one. you can try the `POST` method. Thanks, Ming Wen Twitter: 
   
   @moonming @membphis @juzhiyuan @liuxiran , I guess the real problem is that we can NOT specify a custom (unique) `id` within a `POST` request, which would lead to `{"error_msg":"wrong route id, do not need it"}`. So using `name` as `id` for the uniqueness seems not worked. Looking forward to your feedback, thank you guys.
   
   
   


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