(entries: [string, unknown][])
| 327 | } |
| 328 | |
| 329 | function legacyJsonSchema(entries: [string, unknown][]): JSONSchema7 { |
| 330 | const properties = Object.fromEntries( |
| 331 | entries.filter((entry): entry is [string, JSONSchema7Definition] => isJsonSchemaDefinition(entry[1])), |
| 332 | ) |
| 333 | return { |
| 334 | type: "object", |
| 335 | properties, |
| 336 | required: Object.keys(properties), |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | function zodJsonSchema(schema: z.ZodType): JSONSchema7 { |
| 341 | const result = normalizeZodJsonSchema(z.toJSONSchema(schema, { io: "input", metadata: zodMetadataRegistry(schema) })) |
no test coverage detected