nic-6443 opened a new pull request, #13220:
URL: https://github.com/apache/apisix/pull/13220

   ## Description
   
   The `POST /apisix/admin/configs/validate` endpoint currently only works in 
standalone (YAML) mode. This PR makes it available in etcd mode as well, so 
clients can perform batch configuration validation that includes plugin 
`check_schema()` advanced checks regardless of the deployment mode.
   
   ### Changes
   
   **New module: `apisix/admin/config_validate.lua`**
   Extracts the shared validation logic (validate_configuration, check_conf, 
check_duplicate, validate handler) from standalone.lua into a reusable module.
   
   **Modified: `apisix/admin/standalone.lua`**
   Delegates to the new config_validate module, removing ~140 lines of 
duplicated code while keeping standalone-specific logic (get/update/head, 
patch_schema, config sync).
   
   **Modified: `apisix/admin/init.lua`**
   Registers `POST /apisix/admin/configs/validate` in the etcd mode route 
table, placed before the wildcard route for correct matching priority.
   
   ### Why
   
   Clients using etcd mode (e.g., ADC `adc lint`, Ingress Controller, CI 
pipelines) had no way to perform server-side batch validation that includes 
advanced plugin checks (cross-field constraints, regex compilation, expression 
parsing, recursive sub-plugin validation, etc.). The static JSON Schema from 
the schema API doesn't cover these checks, leading to situations where local 
lint passes but server-side sync fails.
   
   This endpoint accepts the same declarative config format as standalone mode 
and returns all validation errors at once (collect-all mode), making it 
suitable for lint-style workflows.
   


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