diff --git a/.changeset/gentle-tools-nail.md b/.changeset/gentle-tools-nail.md new file mode 100644 index 00000000000..460db34e43f --- /dev/null +++ b/.changeset/gentle-tools-nail.md @@ -0,0 +1,5 @@ +--- +"@effect/schema": patch +--- + +change trimmed json-schema pattern diff --git a/packages/schema/src/Schema.ts b/packages/schema/src/Schema.ts index 2df143c957b..c06742f8b6c 100644 --- a/packages/schema/src/Schema.ts +++ b/packages/schema/src/Schema.ts @@ -3563,7 +3563,7 @@ export const trimmed = filter((a) => a === a.trim(), { typeId: TrimmedTypeId, description: "a string with no leading or trailing whitespace", - jsonSchema: { pattern: "^.*[a-zA-Z0-9]+.*$" }, + jsonSchema: { pattern: "^\\S.*\\S$|^\\S$|^$" }, ...annotations }) )