Skip to content

Commit 0c794a0

Browse files
authored
feat: relax resource name length restriction to 256 (#11822)
1 parent d586819 commit 0c794a0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

apisix/schema_def.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ local labels_def = {
101101

102102
local rule_name_def = {
103103
type = "string",
104-
maxLength = 100,
104+
maxLength = 256,
105105
minLength = 1,
106106
}
107107

t/admin/services.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ qr/\{"error_msg":"the property is forbidden:.*"\}/
12241224
content_by_lua_block {
12251225
local t = require("lib.test_admin").test
12261226
local code, body = t('/apisix/admin/services/1', ngx.HTTP_PUT,
1227-
require("toolkit.json").encode({name = ("1"):rep(101)}))
1227+
require("toolkit.json").encode({name = ("1"):rep(257)}))
12281228

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

12391239

12401240

0 commit comments

Comments
 (0)