shreemaan-abhishek commented on code in PR #8758:
URL: https://github.com/apache/apisix/pull/8758#discussion_r1475574796
##########
apisix/plugins/request-id.lua:
##########
@@ -33,7 +33,12 @@ local schema = {
algorithm = {
type = "string",
enum = {"uuid", "nanoid", "range_id"},
- default = "uuid"
+ default = "uuid",
+ arg_name = {type = "string", default = "req-id"}
+ },
+ oneOf = {
+ {required = {"arg_name"}},
+ {required = {"header_name"}}
Review Comment:
@ZUOXIANGE this will cause the test cases to fail because... both
header_name and arg_name have a default value and regardless of the user
providing/not providing these fields in the plugin... these fields will
automatically be populated with the default values by apisix.
I think to fix this you will have to remove the default value for both the
fields. This will cause a breaking change.
Another way is to add a new field "gen_req_id_from" with default value as
"header" that will use the header to generate request id.
--
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]