refactor(config): drop ZodOverride from PositiveInt in provider.ts (#23215)
This commit is contained in:
@@ -1,12 +1,10 @@
|
|||||||
import { Schema } from "effect"
|
import { Schema } from "effect"
|
||||||
import z from "zod"
|
import { zod } from "@/util/effect-zod"
|
||||||
import { zod, ZodOverride } from "@/util/effect-zod"
|
|
||||||
import { withStatics } from "@/util/schema"
|
import { withStatics } from "@/util/schema"
|
||||||
|
|
||||||
// Positive integer preserving exact Zod JSON Schema (type: integer, exclusiveMinimum: 0).
|
// Positive integer: emits JSON Schema `type: integer, exclusiveMinimum: 0`
|
||||||
const PositiveInt = Schema.Number.annotate({
|
// via the effect-zod walker's well-known refinement translation.
|
||||||
[ZodOverride]: z.number().int().positive(),
|
const PositiveInt = Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0))
|
||||||
})
|
|
||||||
|
|
||||||
export const Model = Schema.Struct({
|
export const Model = Schema.Struct({
|
||||||
id: Schema.optional(Schema.String),
|
id: Schema.optional(Schema.String),
|
||||||
|
|||||||
Reference in New Issue
Block a user