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
|
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 -V or nginx -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):
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):
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+17This is because this code in apisix/cli/file.lua
apisix/apisix/cli/file.lua
Line 127 in a269d61
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
Environment
apisix version): image: apache/apisix:3.14.1-debianuname -a): fedora 43 workstationopenresty -Vornginx -V):curl http://127.0.0.1:9090/v1/server_info): standalone modeluarocks --version):