arktypea
arktype10mo ago
jack

standard schema conforming schema in openauth not working seemingly exclusively with arktype?

i'm using the openauth library which is supposed to support standard schema for
subjects
definition.

i get typesafe output with zod, and the docs use valibot so i assume those 2 work

though with arktype i just get a generic
v1.StandardSchema<unknown, unknown>
type on the resulting object. with zod i get
z.ZodObject<{
    id: z.ZodString;
}, "strip", z.ZodTypeAny, {
    id: string;
}, {
    id: string;
}>


initially i thought this is an issue with openauth, but considering there's this standard schema, and i'm only seeing the issue on arktype i thought i'd come here first, perhaps there's an obvious mistake i'm making? this is the code

export const subjects = createSubjects({
  user: type({ id: type.string }), // arktype
  other_user: z.object({ id: z.string() }), // zod
});


the link to openauth at the start of the message goes to the subjects part in question
Was this page helpful?