-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
It does not seem default values are supported, ie. that the following schema:
const jsonSchema = {
type: "object",
properties: {
field1: { type: "string", default: "test" },
field2: { type: "number", default: 42 },
field3: { type: "boolean", default: true },
field4: { type: "string", enum: ["test1", "test2"], default: "test2" },
field5: {
type: "object",
default: { name: "test", age: 10, isActive: true },
properties: {
name: { type: "string" },
age: { type: "integer", minimum: -43, maximum: 120 },
isActive: { type: "boolean" },
},
required: ["name", "age", "isActive"],
}
},
};
Converts to a zod object that can parse the empty object {}
Metadata
Metadata
Assignees
Labels
No labels