-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: move config-default.yaml to hardcoded lua file #11343
feat: move config-default.yaml to hardcoded lua file #11343
Conversation
This PR has completed most of the work in the proposal, but the update of the documentation is not yet complete. The schema included in APISIX for checking configuration files is outdated and not at all representative of the actual situation. So it cannot be used to generate usable documentation. It needs to be overhauled. Currently, many configurations are not properly documented, some incorrect fields are documented, and the JSON Schema library used by APISIX is highly non-standard and outdated. JSON Schema does not prohibit unlisted fields, so a user can certainly enter something that is not validated. If the issue were to be addressed in this PR, this PR would become very large, which is not conducive to submission. So I would like to make changes in the next PR to include schema's and document generation. Evidence: Configurations not properly documented: https://github.com/apache/apisix/blob/master/apisix/cli/schema.lua#L323-L331 Non-existent fields: https://github.com/apache/apisix/blob/master/apisix/cli/schema.lua#L270-L277 |
Description
For the reasons mentioned in the email https://lists.apache.org/thread/nc7qr5bl0z2bmkfb5rqc01c32lkx0gv2, I'm submitting this PR. The front blocking has been resolved #11312
It moves the config-default.yaml in APISIX to a hardcoded Lua. While it is still a script file in the distribution of APISIX, you can think of it as a "binary" and the user gets the clear and unambiguous message "it should never be modified".
And since it's a script file, it'll be more expressive than a pure Lua, e.g. we can read some of the values from environment variables (although I have a better way of doing that).
Email copy:
Checklist