Closed saurabhjakhade closed 3 years ago
Hi, can you prepare me a repo with minimal test case?
I've pushed changes to the package bumping apispec itself, can you install trunk version and check if this resolves your issue?
Helped me.
Installing the master branch of pyramid_apispec
resolved the error AttributeError: 'List' object has no attribute 'container'
for me as well (and that upgrade bumped apispec to 4.0.0).
Is there a timeframe or other needs for pushing a new release to PyPI?
Edit: Working with this a little more I found that the current example in the README doesn't work with apispec>=2.0.0
, I'm going to open an issue (and hopefully PR) for that. In case that affects your plans for releasing to PyPI.
Hi, I'm sorry this completely fell off my mind. I've made a new release of the package.
I am unable to create / generate API specification using marshmallow schema containing field having type as list/array of String.
Details : My local version details -
"pyramid_apispec==0.3.3", "marshmallow==3.6.1 , pyramid==1.10.4 , python == 3.7.3"
My code looks like :
import marshmallow from marshmallow import fields, validate
class BaseSchema(marshmallow.Schema): class Meta: strict = True ordered = True
class MyCustomSchema(BaseSchema) : app_ids = fields.List(fields.String())
Here when I tried to access api specification http://localhost:8080/api-explorer . I got following error –
File "d:\saurabh\june-venv\lib\site-packages\apispec\core.py", line 143, in schema ret.update(plugin.schema_helper(name, component, kwargs) or {}) File "d:\saurabh\june-venv\lib\site-packages\apispec\ext\marshmallow__init__.py", line 169, in schema_helper json_schema = self.openapi.schema2jsonschema(schema_instance) File "d:\saurabh\june-venv\lib\site-packages\apispec\ext\marshmallow\openapi.py", line 657, in schema2jsonschema jsonschema = self.fields2jsonschema(fields, partial=partial, ordered=ordered) File "d:\saurabh\june-venv\lib\site-packages\apispec\ext\marshmallow\openapi.py", line 681, in fields2jsonschema property = self.field2property(field_obj) File "d:\saurabh\june-venv\lib\site-packages\apispec\ext\marshmallow\openapi.py", line 433, in field2property ret["items"] = self.field2property(field.container) AttributeError: 'List' object has no attribute 'container'**