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

Strict Validation Causes AttributeError #61

Open
jdrew82 opened this issue Dec 3, 2020 · 0 comments
Open

Strict Validation Causes AttributeError #61

jdrew82 opened this issue Dec 3, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@jdrew82
Copy link

jdrew82 commented Dec 3, 2020

Environment

  • Python version: 3.8.3
  • schema-enforcer version: 0.1.1

Expected Behavior

Validation completes with strict enforcement and provides results back.

Observed Behavior

Traceback (most recent call last):
  File "/Users/justin.drew/Library/Caches/pypoetry/virtualenvs/gizmo-9me0dq9Y-py3.8/bin/schema-enforcer", line 8, in <module>
    sys.exit(main())
  File "/Users/justin.drew/Library/Caches/pypoetry/virtualenvs/gizmo-9me0dq9Y-py3.8/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/justin.drew/Library/Caches/pypoetry/virtualenvs/gizmo-9me0dq9Y-py3.8/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/justin.drew/Library/Caches/pypoetry/virtualenvs/gizmo-9me0dq9Y-py3.8/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/justin.drew/Library/Caches/pypoetry/virtualenvs/gizmo-9me0dq9Y-py3.8/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/justin.drew/Library/Caches/pypoetry/virtualenvs/gizmo-9me0dq9Y-py3.8/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/justin.drew/Library/Caches/pypoetry/virtualenvs/gizmo-9me0dq9Y-py3.8/lib/python3.8/site-packages/schema_enforcer/cli.py", line 78, in validate
    for result in instance.validate(smgr, strict):
  File "/Users/justin.drew/Library/Caches/pypoetry/virtualenvs/gizmo-9me0dq9Y-py3.8/lib/python3.8/site-packages/schema_enforcer/schemas/jsonschema.py", line 51, in validate
    validator = self.__get_strict_validator()
  File "/Users/justin.drew/Library/Caches/pypoetry/virtualenvs/gizmo-9me0dq9Y-py3.8/lib/python3.8/site-packages/schema_enforcer/schemas/jsonschema.py", line 119, in __get_strict_validator
    items = prop.get("items", {})
AttributeError: 'CommentedSeq' object has no attribute 'get'

Steps to Reproduce

  1. Create schema.
  2. Attempt to do a strict validation with "schema-enforcer validate --strict"
  3. Profit?
@PhillSimonds PhillSimonds added this to the v1.0.1 Release milestone Feb 1, 2021
@dgarros dgarros added the bug Something isn't working label Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants