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

UUID: add title annotation #320

Merged
merged 1 commit into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ""`
)
})
})
Loading