Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I create a recursive scheme? #69

Open
RusAnonym opened this issue Jan 12, 2021 · 0 comments
Open

How do I create a recursive scheme? #69

RusAnonym opened this issue Jan 12, 2021 · 0 comments

Comments

@RusAnonym
Copy link

Good afternoon, is it possible to create a recursive scheme?

const products = createSchema({
	id: Type.number({ required: true }),
	products: Type.array({ required: true }).of(products),
});

I tried to create a recursive scheme with .add

const products = createSchema({
	id: Type.number({ required: true }),
});

products.add({
	products: Type.array({ required: true }).of(products),
});

But it didn't help me ;C
image

Can you please tell me how to solve this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant