From c953d3467d97b0a0f9ce6041b1cd717b7f43b4ee Mon Sep 17 00:00:00 2001 From: aditya-ignite <62281966+aditya-ignite@users.noreply.github.com> Date: Wed, 21 Oct 2020 10:26:57 +0530 Subject: [PATCH] schema.py: Fix for get_nested_fields Having a list field on schema is giving an error after upgrading to the latest version. The get_nested_fields function is trying to access an attribute 'container' on a list field, which as per latest marshmallow version does not exist. So replacing it with a new field called 'inner'. --- flask_rest_jsonapi/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_rest_jsonapi/schema.py b/flask_rest_jsonapi/schema.py index f7bff52..c591afc 100644 --- a/flask_rest_jsonapi/schema.py +++ b/flask_rest_jsonapi/schema.py @@ -106,7 +106,7 @@ def get_nested_fields(schema, model_field=False): nested_fields = [] for (key, value) in schema._declared_fields.items(): - if isinstance(value, List) and isinstance(value.container, Nested): + if isinstance(value, List) and isinstance(value.inner, Nested): nested_fields.append(key) elif isinstance(value, Nested): nested_fields.append(key)