-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Current Behavior
Im using apisix, with standalone mode, in which ive noticed that when a env variable is set in apisix.yaml file, if the value is a number, it will automatically convert it to number, and this causes an error if the number is bigger than Lua's double, for example (extracted from my apisix.yaml file):
plugin_configs:
- id: 1
plugins:
openid-connect:
client_id: "${{APISIX_OIDC_CLIENT_ID}}"
Note the double " in the env var, still it doesnt treat it like an string
The APISIX_OIDC_CLIENT_ID is set to "356002209726529540" but the value is casted to "client_id":3.5600220972653e+17
This is because this code in apisix/cli/file.lua
Line 127 in a269d61
| if tonumber(new_val) ~= nil then |
Expected Behavior
I expect that the value passed in as "${{var}}" works like an string
Error Logs
2026/01/22 06:11:11 [error] 57#57: *321192 [lua] config_yaml.lua:333: failed to check item data of [plugin_configs] err:failed to check the configuration of plugin openid-connect err: property "client_id" validation failed: wrong type: expected string, got number ,val:
Steps to Reproduce
- Run APISIX via the docker image
- Configure it as standalone mode with env variable - APISIX_DEPLOYMENT_MODE=standalone
- Configure env variable with number inside bigger than lua's double eg "356002209726529540"
- Set the variable in apisix.yaml in "${{}}" format
- Get the error, in this case im using openid-connect plugin
Environment
- APISIX version (run
apisix version): image: apache/apisix:3.14.1-debian - Operating system (run
uname -a): fedora 43 workstation - OpenResty / Nginx version (run
openresty -Vornginx -V): - etcd version, if relevant (run
curl http://127.0.0.1:9090/v1/server_info): standalone mode - APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run
luarocks --version):
Metadata
Metadata
Assignees
Labels
Type
Projects
Status