Skip to content

Getting UnboundLocalError #157

@jinsooihm

Description

@jinsooihm

Hello,

I am getting a weird error when trying to run validate.

data = ["str"]
schema = {"minItems":1, "minLength": 1}
fastjsonschema.validate(schema, data)

gives

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../fastjsonschema/__init__.py", line 114, in validate
    return compile(definition, handlers, formats, use_default)(data)
  File "<string>", line 10, in validate
UnboundLocalError: local variable 'data_len' referenced before assignment

It seems like something goes wrong when using minItems/maxItems with minLength/maxLength?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions