Closed adriencaccia closed 4 months ago
Hi @adriencaccia and thanks for the issue !
It should work fine with v3.0.1, although you'll have to rename $defs
to definitions
:
const FooSchema = {
type: "object",
properties: {
bar: { $ref: "#/definitions/Bar" },
},
required: ["bar"],
definitions: {
Bar: {
type: "object",
properties: {
baz: {
type: "string",
nullable: true,
},
},
}
},
} as const satisfies JSONSchema;
type Foo = FromSchema<typeof FooSchema>; // should work fine!
Thank you for the quick fix, it works perfectly 👍
Hey, there is a TypeScript error when using
nullable
in a definition schema.The type
Foo
is correct with:But there is a TypeScript error at the
nullable: true
line:It would be great to not have this error, as this works at the type level.
Thanks!