ajv-validator / ajv-validator/ajv-cli

error: Maximum call stack size exceeded with schemas having ~510 properties or more

Offen
#134 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
316
Forks
77
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I recently discovered that bigger generated schemas can easily produce a a `error: Maximum call stack size exceeded`, even when the checks are quite simple.
```
ajv -- validate --strict=false --errors=json -s f/ansible-playbook.json -d /Users/ssbarnea/c/a/schemas/examples/playbooks/run.yml
schema f/ansible-playbook.json is invalid
error: Maximum call stack size exceeded
```

Based on my initial tests 500 properties worked but 1000 generated this error, which is a very low number. My expectation that that I will likely need 10k in the end. I tested with 510 and job only one schema failing instead of both, with 550 both failed. Clearly the moment it starts to fail is just after 500.

I am not sure what is confusing the loader because in the end the entries are very simple.

Here is one file that has ~1000 entries https://sbarnea.com/ss/ansible-playbook.json and is only ~100kb, just removing some of the properties will make it pass.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.