Skip to content

error; "control structure too long" #11

@Tieske

Description

@Tieske

The source of this error is explained here

The reason this happens is an object with 1899 fields to be validated. All of the checks are generated sequentially, and create a structure that is too large.

To raise the bar for hitting this error, we could group similar validations, and then deal with those in a loop. Eg. in the example 1899 most fields just have a type and "required", so probably appr. 10 different sets of checks can be generated, and the 1899 entries can then be looping over those checks.

The code starts here: https://github.com/Tieske/lua-resty-ljsonschema/blob/master/src/resty/ljsonschema/init.lua#L439

This is quite a complex change

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions