You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The convertion from marshmallow schema to json_schema fails for fields that are declared as method. For instance, for the user management, the conversion of the is_current_user fails.
Steps to Reproduce
With version 1.5.0:
Traceback (most recent call last):
File "/Users/psaiz/github/invenio-administration/invenio_administration/marshmallow_utils.py", line 104, in jsonify_schema
"type": custom_mapping[field_type_name],
KeyError: <class 'marshmallow.fields.Method'>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/psaiz/.local/share/virtualenvs/psaiz-master-PcfYpoPq/lib/python3.9/site-packages/flask/app.py", line 2552, in __call__
return self.wsgi_app(environ, start_response)
File "/Users/psaiz/.local/share/virtualenvs/psaiz-master-PcfYpoPq/lib/python3.9/site-packages/werkzeug/middleware/proxy_fix.py", line 187, in __call__
return self.app(environ, start_response)
File "/Users/psaiz/.local/share/virtualenvs/psaiz-master-PcfYpoPq/lib/python3.9/site-packages/werkzeug/middleware/dispatcher.py", line 78, in __call__
return app(environ, start_response)
File "/Users/psaiz/.local/share/virtualenvs/psaiz-master-PcfYpoPq/lib/python3.9/site-packages/flask/app.py", line 2532, in wsgi_app
response = self.handle_exception(e)
File "/Users/psaiz/.local/share/virtualenvs/psaiz-master-PcfYpoPq/lib/python3.9/site-packages/flask/app.py", line 2529, in wsgi_app
response = self.full_dispatch_request()
File "/Users/psaiz/.local/share/virtualenvs/psaiz-master-PcfYpoPq/lib/python3.9/site-packages/flask/app.py", line 1825, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/psaiz/.local/share/virtualenvs/psaiz-master-PcfYpoPq/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/psaiz/.local/share/virtualenvs/psaiz-master-PcfYpoPq/lib/python3.9/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/Users/psaiz/.local/share/virtualenvs/psaiz-master-PcfYpoPq/lib/python3.9/site-packages/flask_principal.py", line 199, in _decorated
rv = f(*args, **kw)
File "/Users/psaiz/.local/share/virtualenvs/psaiz-master-PcfYpoPq/lib/python3.9/site-packages/flask/views.py", line 107, in view
return current_app.ensure_sync(self.dispatch_request)(**kwargs)
File "/Users/psaiz/.local/share/virtualenvs/psaiz-master-PcfYpoPq/lib/python3.9/site-packages/flask/views.py", line 188, in dispatch_request
return current_app.ensure_sync(meth)(**kwargs)
File "/Users/psaiz/github/invenio-administration/invenio_administration/views/base.py", line 388, in get
serialized_schema = self._schema_to_json(schema)
File "/Users/psaiz/github/invenio-administration/invenio_administration/views/base.py", line 195, in _schema_to_json
return jsonify_schema(schema)
File "/Users/psaiz/github/invenio-administration/invenio_administration/marshmallow_utils.py", line 109, in jsonify_schema
raise Exception(f"Unrecognised schema field {field}: {field_type_name}")
Exception: Unrecognised schema field is_current_user: <class 'marshmallow.fields.Method'>
Package version (if known):1.5.0
Describe the bug
The convertion from marshmallow schema to json_schema fails for fields that are declared as method. For instance, for the user management, the conversion of the
is_current_user
fails.Steps to Reproduce
With version 1.5.0:
As a workaround, the following code was added:
This might need some better implementation
Expected behavior
Screenshots (if applicable)
Additional context
The text was updated successfully, but these errors were encountered: