Skip to content

Commit 9318e2b

Browse files
committed
User-specified ID schema now supports UUIDs
1 parent 19927d7 commit 9318e2b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/stack-shared/src/schema-fields.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ export const dayIntervalOrNeverSchema = yupUnion(dayIntervalSchema.defined(), yu
423423
* This schema is useful for fields where the user can specify the ID, such as price IDs. It is particularly common
424424
* for IDs in the config schema.
425425
*/
426-
export const userSpecifiedIdSchema = (idName: `${string}Id`) => yupString().max(63).matches(/^[a-zA-Z_][a-zA-Z0-9_-]*$/, `${idName} must start with a letter or underscore and contain only letters, numbers, underscores, and hyphens`);
426+
export const userSpecifiedIdSchema = (idName: `${string}Id`) => yupString().max(63).matches(/^[a-zA-Z_][a-zA-Z0-9_-]*$/, `${idName} must start with a letter, underscore, or number, and contain only letters, numbers, underscores, and hyphens`);
427427
export const moneyAmountSchema = (currency: Currency) => yupString<MoneyAmount>().test('money-amount', 'Invalid money amount', (value, context) => {
428428
if (value == null) return true;
429429
const regex = /^([0-9]+)(\.([0-9]+))?$/;

0 commit comments

Comments
 (0)