-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
Issue description
Create a Service with a custom ID. Cannot create a Service with an ID as a string
ex:
/apisix/admin/services/{id} //id-> 5ed8b4902b0b28f6b3b4e0a4
/apisix/admin/services/5ed8b4902b0b28f6b3b4e0a4
But if you create Upstream, the ID will be a string
Environment
- apisix version (cmd:
apisix version
): 1.3 - OS: Linux (Fedora 32 WS)
Minimal test code / Steps to reproduce the issue
1、curl -s http://127.0.0.1:9080/apisix/admin/services/5ed8b4902b0b28f6b3b4e0a4 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -i -X PUT -d '{"desc":"hello world","upstream_id":"5ed77d7ba565f16210f76fcd"}' | awk 'END {print}' | jq .
What's the actual result? (including assertion message & call stack if applicable)
{
"error_msg": "wrong type of service id"
}
What's the expected result?
You can create a resource as an ID of the string type
if need_id and not tonumber(id) then
return nil, {error_msg = "wrong type of service id"}
end
tonumber ?
Metadata
Metadata
Assignees
Labels
No labels