Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Tutorial 07 requires jsonschema 3.2.0 #108

Open
m-strasser opened this issue Oct 4, 2021 · 0 comments
Open

Tutorial 07 requires jsonschema 3.2.0 #108

m-strasser opened this issue Oct 4, 2021 · 0 comments
Labels

Comments

@m-strasser
Copy link

Package version (if known):

Describe the bug

Step 5 in tutorial 07 fails if the latest version of jsonschema is installed (see stacktrace below). This can be fixed by downgrading to jsonschema 3.2.0 (by running pip install --upgrade jsonschema==3.2.0 in the virtual environment), avoiding the API change introduced in version 4 of jsonschema.

Steps to Reproduce

  1. Follow tutorial 07
  2. Observe TypeError

Expected behavior

Successfully complete step 5 of the tutorial.

Screenshots (if applicable)

Additional context

Stacktrace:

127.0.0.1 - - [30/Sep/2021 15:00:38] "POST /api/records/?prettyprint=1 HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/path/to/my/venv/lib/python3.9/site-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/path/to/my/venv/lib/python3.9/site-packages/werkzeug/middleware/dispatcher.py", line 66, in __call__
    return app(environ, start_response)
  File "/path/to/my/venv/lib/python3.9/site-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/path/to/my/venv/lib/python3.9/site-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/path/to/my/venv/lib/python3.9/site-packages/flask_restful/__init__.py", line 271, in error_router
    return original_handler(e)
  File "/path/to/my/venv/lib/python3.9/site-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/path/to/my/venv/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/path/to/my/venv/lib/python3.9/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/path/to/my/venv/lib/python3.9/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/path/to/my/venv/lib/python3.9/site-packages/flask_restful/__init__.py", line 271, in error_router
    return original_handler(e)
  File "/path/to/my/venv/lib/python3.9/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/path/to/my/venv/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/path/to/my/venv/lib/python3.9/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/path/to/my/venv/lib/python3.9/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/path/to/my/venv/lib/python3.9/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/path/to/my/venv/lib/python3.9/site-packages/invenio_rest/views.py", line 239, in dispatch_request
    result = super(ContentNegotiatedMethodView, self).dispatch_request(
  File "/path/to/my/venv/lib/python3.9/site-packages/flask/views.py", line 163, in dispatch_request
    return meth(*args, **kwargs)
  File "/path/to/my/venv/lib/python3.9/site-packages/invenio_records_rest/views.py", line 428, in need_record_permission_decorator
    return f(self, record=record, *args, **kwargs)
  File "/path/to/my/venv/lib/python3.9/site-packages/invenio_records_rest/views.py", line 695, in post
    record = self.record_class.create(data, id_=record_uuid)
  File "/path/to/my/venv/lib/python3.9/site-packages/invenio_records_files/api.py", line 322, in create
    record = super(Record, cls).create(data, id_=id_, **kwargs)
  File "/path/to/my/venv/lib/python3.9/site-packages/invenio_records/api.py", line 303, in create
    record._validate(
  File "/path/to/my/venv/lib/python3.9/site-packages/invenio_records/api.py", line 183, in _validate
    _records_state.validate(
  File "/path/to/my/venv/lib/python3.9/site-packages/invenio_records/ext.py", line 35, in validate
    return validate(
  File "/path/to/my/venv/lib/python3.9/site-packages/jsonschema/validators.py", line 964, in validate
    validator = cls(schema, *args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'types'
@m-strasser m-strasser added the bug label Oct 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant