Skip to content

Commit fde2c5f

Browse files
authored
fix(consumers): username supports hyphen (#3150)
1 parent bee39c2 commit fde2c5f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/types/schema/apisix/consumers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ const Consumer = z
2424
username: z
2525
.string()
2626
.min(1)
27-
.regex(/^[a-zA-Z0-9_]+$/),
27+
// ref: https://github.com/apache/apisix/blob/a2482df74d712228a1a6644662d74d2f51a3f5e6/apisix/schema_def.lua#L713
28+
.regex(/^[a-zA-Z0-9_-]+$/),
2829
plugins: APISIXPlugins.Plugins.optional(),
2930
group_id: z.string().optional(),
3031
})

0 commit comments

Comments
 (0)