Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apisix/schema_def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ local labels_def = {

local rule_name_def = {
type = "string",
maxLength = 100,
maxLength = 256,
Copy link
Member

@SkyeYoung SkyeYoung Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to PR:

I read the documentation and found that the API previously defined using this schema didn't specify any maximum field lengths.

I think this should be improved in the future, for example, by using OpenAPI documentation.

minLength = 1,
}

Expand Down
4 changes: 2 additions & 2 deletions t/admin/services.t
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ qr/\{"error_msg":"the property is forbidden:.*"\}/
content_by_lua_block {
local t = require("lib.test_admin").test
local code, body = t('/apisix/admin/services/1', ngx.HTTP_PUT,
require("toolkit.json").encode({name = ("1"):rep(101)}))
require("toolkit.json").encode({name = ("1"):rep(257)}))

ngx.status = code
ngx.print(body)
Expand All @@ -1237,7 +1237,7 @@ qr/\{"error_msg":"the property is forbidden:.*"\}/
GET /t
--- error_code: 400
--- response_body
{"error_msg":"invalid configuration: property \"name\" validation failed: string too long, expected at most 100, got 101"}
{"error_msg":"invalid configuration: property \"name\" validation failed: string too long, expected at most 256, got 257"}



Expand Down
Loading