Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 06:00 UTC
| 1 | import { describe, expect, it } from 'vitest'; |
| 2 | import * as z4 from 'zod/v4'; |
| 3 | |
| 4 | import { jsonSchemaToZod } from '../../src/v4'; |
| 5 | import type { JsonSchema } from '../../src/types'; |
| 6 | import { loadObjectCases, loadStrictCases } from '../fixtures/corpus'; |
| 7 | |
| 8 | const everyCase = [ |
| 9 | ...loadObjectCases().map(({ id, schema }) => ({ id: `object:${id}`, schema })), |
| 10 | ...loadStrictCases().map(({ id, schema }) => ({ id: `strict:${id}`, schema })), |
| 11 | ]; |
| 12 | |
| 13 | describe('v4 JSON Schema rendering', () => { |
| 14 | describe.each(['input', 'output'] as const)('with io %s', io => { |
| 15 | it.each(everyCase)('renders $id', ({ schema }) => { |
| 16 | const converted = jsonSchemaToZod(schema as JsonSchema); |
| 17 | expect(() => z4.toJSONSchema(converted, { io })).not.toThrow(); |
| 18 | }); |
| 19 | }); |
| 20 | }); |