Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

next
ts 23 lines 736 Bytes
Raw
1 /**
2 * The JSON Schema the v4 builder renders for the shared corpus, as the
3 * review artifact for moving core and the providers onto it.
4 */
5 import { describe, expect, it } from 'vitest';
6 import * as z4 from 'zod/v4';
7
8 import { jsonSchemaToZod } from '../../src/v4';
9 import type { JsonSchema } from '../../src/types';
10 import { loadObjectCases } from '../fixtures/corpus';
11
12 describe('v4 JSON Schema of the shared corpus', () => {
13 it('matches the pinned snapshot', () => {
14 const cases = loadObjectCases().map(({ id, schema }) => ({
15 id,
16 jsonSchema: z4.toJSONSchema(jsonSchemaToZod(schema as JsonSchema), {
17 io: 'input',
18 target: 'draft-7',
19 }),
20 }));
21 expect(cases).toMatchSnapshot();
22 });
23 });