You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "SkyeYoung (via GitHub)" <gi...@apache.org> on 2025/07/24 06:38:27 UTC

Re: [PR] fix(consumers): username supports hyphen [apisix-dashboard]

SkyeYoung commented on code in PR #3150:
URL: https://github.com/apache/apisix-dashboard/pull/3150#discussion_r2227222966


##########
src/types/schema/apisix/consumers.ts:
##########
@@ -24,7 +24,8 @@ const Consumer = z
     username: z
       .string()
       .min(1)
-      .regex(/^[a-zA-Z0-9_]+$/),
+      // ref: https://github.com/apache/apisix/blob/a2482df74d712228a1a6644662d74d2f51a3f5e6/apisix/schema_def.lua#L713
+      .regex(/^[a-zA-Z0-9_-]+$/),

Review Comment:
   This regex is equivalent to apisix.
   
   <img width="300" alt="Image" src="https://github.com/user-attachments/assets/a28ef2a3-31cb-4a06-b9ea-62a1835ad296" />



-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org