ajv-validator / ajv-validator/ajv

Windows: `Maximum call stack size exceeded` when number of items in `anyOf` is more than 1700

Aberta
#1,705 15 comentários 0 reações 0 responsáveis Ver no GitHub
limitation
Linguagem predominante
TypeScript
Estrelas
14.8k
Forks
1k
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

I have a schema where one of the field `km04` is having 1700+ options, whenever I am trying to validate the object send from client, with 1700+ options for the `km04` field, it is specifically throwing an error in windows for `Maximum call stack`, this error is not replicable in mac, or even in windows if we reduce the number of options available for the `km04` field below 1700.

here is the sample schema,
[schema.txt](https://github.com/ajv-validator/ajv/files/6854268/schema.txt)

**The version of Ajv you are using**
`6.12.3`

**The environment you have the problem with**
`Windows`

**Your code (please make it as small as possible to reproduce the issue)**
`ajv.validate(schema, body);`

**If your issue is in the browser, please list the other packages loaded in the page in the order they are loaded. Please check if the issue gets resolved (or results change) if you move Ajv bundle closer to the top**
It is not in browser

**Results in node.js v8+**
Maximum call stack size exceeded

**Results and error messages in your platform**
```
Maximum call stack size exceeded

\node_modules\\ajv\\lib\\compile\\index.js:120:26)
at Ajv.compile (\node_modules\\ajv\\lib\\compile\\index.js:55:13)
at Ajv._compile (\node_modules\\ajv\\lib\\ajv.js:348:27)
at Ajv.validate (\node_modules\\ajv\\lib\\ajv.js:96:36)
```

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.