bzp2010 commented on code in PR #12551:
URL: https://github.com/apache/apisix/pull/12551#discussion_r2354476146
##########
apisix/core/schema.lua:
##########
@@ -68,4 +70,9 @@ end
_M.valid = get_validator
+setmetatable(_M, {
+ __index = schema_def,
+ __newindex = function() error("no modification allowed") end,
Review Comment:
I'm not sure what its purpose is, but this approach cannot prevent
`schema_def` from being modified. The `__newindex` is only called when the key
to be modified does not exist in the original table; it is not invoked for
fields that already exist.
##########
apisix/core.lua:
##########
@@ -48,7 +48,7 @@ return {
request = require("apisix.core.request"),
response = require("apisix.core.response"),
lrucache = require("apisix.core.lrucache"),
- schema = require("apisix.schema_def"),
+ schema = require("apisix.core.schema"),
Review Comment:
What's the purpose? To unify things?
--
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]