jesse-r-s-hines opened a new issue, #10683:
URL: https://github.com/apache/apisix/issues/10683

   ### Current Behavior
   
   It appears that the apisix.yaml parses numbers as strings in some 
situations. This causes plugins like the `workflow` plugin to be unusable in 
standalone mode as they validate parts of their plugin config to be ints.
   
   ### Expected Behavior
   
   To be able to have numbers in the apisix.yaml standlone mode, and a 
standards compliant YAML parser
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   ```yaml
   services:
     - id: myservice
       upstream:
         type: roundrobin
         nodes:
           "service:8080": 1
   
   plugin_configs:
     - id: myconfig
       plugins:
         workflow:
           rules:
           - case: [["status", "==", 302]]
             actions: [["return", {"code": 401}]]
         
   routes:
     - uri: '/*'
       service_id: myservice
       plugin_config_id: myconfig
   
   #END
   ```
   
   This will fail plugin validation, and show errors like this in the logs
   ```
   2023/12/20 19:32:33 [error] 36#36: *5 [lua] config_yaml.lua:218: failed to 
check item data of [plugin_configs] err:failed to check the configuration of 
plugin workflow err: failed to validate the 'return' action: property "code" 
validation failed: wrong type: expected integer, got string ,val: 
{"id":"myconfig","plugins":{"workflow":{"rules":[{"case":[["status","==","302"]],"actions":[["return",{"_vid":1,"code":"401"}]]}]}}},
 context: init_worker_by_lua*
   ```
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.7.0
   - Operating system (run `uname -a`): Linux
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): 
openresty/1.21.4.2
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to