|
|
@@ -1,12 +1,10 @@
|
|
|
import { Schema } from "effect"
|
|
|
-import z from "zod"
|
|
|
-import { zod, ZodOverride } from "@/util/effect-zod"
|
|
|
+import { zod } from "@/util/effect-zod"
|
|
|
import { withStatics } from "@/util/schema"
|
|
|
|
|
|
-// Positive integer preserving exact Zod JSON Schema (type: integer, exclusiveMinimum: 0).
|
|
|
-const PositiveInt = Schema.Number.annotate({
|
|
|
- [ZodOverride]: z.number().int().positive(),
|
|
|
-})
|
|
|
+// Positive integer: emits JSON Schema `type: integer, exclusiveMinimum: 0`
|
|
|
+// via the effect-zod walker's well-known refinement translation.
|
|
|
+const PositiveInt = Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0))
|
|
|
|
|
|
export const Model = Schema.Struct({
|
|
|
id: Schema.optional(Schema.String),
|