yixianOu commented on code in PR #12795:
URL: https://github.com/apache/apisix/pull/12795#discussion_r2621516315
##########
t/plugin/ai-proxy.t:
##########
@@ -671,3 +671,49 @@ POST /embeddings
--- error_code: 200
--- response_body_like eval
qr/.*text-embedding-ada-002*/
+
+
+
+=== TEST 17: schema accepts 'logging' and ignores unknown 'logging_schema'
+--- config
+ location /t {
+ content_by_lua_block {
+ local plugin = require("apisix.plugins.ai-proxy")
+
+ local ok1, err1 = plugin.check_schema({
+ provider = "openai",
+ auth = { header = { apikey = "token" } },
+ options = { model = "gpt-4" },
+ logging = { summaries = true, payloads = false },
+ })
+
+ local ok2, err2 = plugin.check_schema({
+ provider = "openai",
+ auth = { header = { apikey = "token" } },
+ options = { model = "gpt-4" },
+ logging_schema = { summaries = true },
+ })
Review Comment:
- **Why the test was originally written this way:** It verified that the
valid `logging` field passes and that old/unknown fields (e.g.,
`logging_schema`) don’t block schema validation, since `additionalProperties`
is allowed.
- **Why I changed it:** We only care that `logging` passes. Removing the
extra check reduces noise and decouples the test from the “allow unknown
fields” behavior, keeping the test focused and stable.
https://github.com/apache/apisix/actions/runs/20239133460/job/58149992555?pr=12795
https://github.com/apache/apisix/actions/runs/20239133460/job/58149992556?pr=12795
The failed CI test should have nothing to do with the code I modified
--
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]