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

Error using apispec >= 5 #38

Open
mahenzon opened this issue Aug 19, 2021 · 0 comments
Open

Error using apispec >= 5 #38

mahenzon opened this issue Aug 19, 2021 · 0 comments

Comments

@mahenzon
Copy link
Contributor

Freeze apispec <5 or update to make compatible
In latest marshmallow new fields are declared, and apispec uses them

Traceback:

Traceback (most recent call last):
  File "/projects/flask-jsonapi-aug/app.py", line 29, in <module>
    api.route(PersonList, "person_list", "/persons", tag="Person")
  File "/projects/flask-jsonapi-aug/venv/lib/python3.9/site-packages/flask_combo_jsonapi/api.py", line 111, in route
    i_plugin.after_route(resource=resource, view=view, urls=urls, self_json_api=self, **kwargs)
  File "/projects/flask-jsonapi-aug/venv/lib/python3.9/site-packages/combojsonapi/spec/plugin.py", line 113, in after_route
    self._add_definitions_in_spec(resource.schema)
  File "/projects/flask-jsonapi-aug/venv/lib/python3.9/site-packages/combojsonapi/spec/plugin.py", line 459, in _add_definitions_in_spec
    self.spec.components.schema(name_schema, schema=schema)
  File "/projects/flask-jsonapi-aug/venv/lib/python3.9/site-packages/apispec/core.py", line 132, in schema
    ret.update(plugin.schema_helper(component_id, ret, **kwargs) or {})
  File "/projects/flask-jsonapi-aug/venv/lib/python3.9/site-packages/apispec/ext/marshmallow/__init__.py", line 166, in schema_helper
    json_schema = self.converter.schema2jsonschema(schema_instance)
  File "/projects/flask-jsonapi-aug/venv/lib/python3.9/site-packages/apispec/ext/marshmallow/openapi.py", line 182, in schema2jsonschema
    jsonschema = self.fields2jsonschema(fields, partial=partial, ordered=ordered)
  File "/projects/flask-jsonapi-aug/venv/lib/python3.9/site-packages/apispec/ext/marshmallow/openapi.py", line 208, in fields2jsonschema
    prop = self.field2property(field_obj)
  File "/projects/flask-jsonapi-aug/venv/lib/python3.9/site-packages/apispec/ext/marshmallow/field_converter.py", line 172, in field2property
    ret.update(attr_func(field, ret=ret))
  File "/projects/flask-jsonapi-aug/venv/lib/python3.9/site-packages/apispec/ext/marshmallow/field_converter.py", line 219, in field2default
    default = field.load_default
AttributeError: 'String' object has no attribute 'load_default'
mahenzon added a commit that referenced this issue Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant