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

AttributeError: 'dict' object has no attribute 'data' on on List of Nested fields #62

Closed
bnopne opened this issue Jul 13, 2018 · 4 comments

Comments

@bnopne
Copy link

bnopne commented Jul 13, 2018

I get 'dict' object has no attribute 'data' when i try to generate JSON schema for a model which contains List of Nested fields, here is an example of broken code:

        class User(Schema):
            f1 = fields.Integer()

        class UserList(Schema):
            f2 = fields.List(fields.Nested(User))


        JSONSchema().dump(UserList())

Python 3.6.4
marshmallow==3.0.0b11
marshmallow-jsonschema==0.5.0

@fuhrysteve
Copy link
Owner

fuhrysteve commented Jul 13, 2018

Thanks for the report!

Please see #61

this library is not yet compatible with marshmallow >= 3, but once we get a couple minor things sorted out on #61 we'll be good to go.

If you want to start playing around with it on v3, installing from @edgeware's fork should work in the meantime:

pip install -e 'git+https://github.com/edgeware/marshmallow-jsonschema.git@21633cfdbb13eb572727e14ca7b862613f0985d3#egg=marshmallow-jsonschema-dev'

@bnopne
Copy link
Author

bnopne commented Jul 16, 2018

Thanks for clarification and help!

Switching marshmallow to 2.x.x helped me to solve the problem.

@bnopne bnopne closed this as completed Jul 16, 2018
@alkanen
Copy link
Contributor

alkanen commented Jul 18, 2018

@bnopne a proper fix for the issue was merged yesterday so you can use Marshmallow 3.x now if you want to.

@bnopne
Copy link
Author

bnopne commented Jul 18, 2018

@alkanen Thanks a lot! May the Force be with you!

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

3 participants