Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
UUID: add title annotation (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti authored Jul 6, 2023
1 parent 0c6cc97 commit 8f09893
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/nice-steaks-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/schema": patch
---

UUID: add title annotation
1 change: 1 addition & 0 deletions src/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2747,6 +2747,7 @@ export const UUID: Schema<string> = pipe(
string,
pattern(uuidRegex, {
typeId: UUIDTypeId,
title: "UUID",
arbitrary: (): Arbitrary<string> => (fc) => fc.uuid()
})
)
Expand Down
2 changes: 1 addition & 1 deletion test/data/filter/UUID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe.concurrent("UUID", () => {
await Util.expectParseFailure(
schema,
"",
`Expected a string matching the pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$, actual ""`
`Expected UUID, actual ""`
)
})
})

0 comments on commit 8f09893

Please sign in to comment.