mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
feat: Add fork of json-schema-to-zod (no-changelog) (#11228)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { parseSchema } from '../../src/parsers/parse-schema';
|
||||
|
||||
describe('parseNullable', () => {
|
||||
test('parseSchema should not add default twice', () => {
|
||||
expect(
|
||||
parseSchema(
|
||||
{
|
||||
type: 'string',
|
||||
nullable: true,
|
||||
default: null,
|
||||
},
|
||||
{ path: [], seen: new Map() },
|
||||
),
|
||||
).toMatchZod(z.string().nullable().default(null));
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user