From 2fc4155e86970582bea9a0f370d9e212c55b111b Mon Sep 17 00:00:00 2001 From: Sebastien De Fauw Date: Wed, 16 Dec 2020 10:34:20 +0100 Subject: [PATCH] props_ordered does not work for nested fields --- marshmallow_jsonschema/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/marshmallow_jsonschema/base.py b/marshmallow_jsonschema/base.py index 6711955..ca2c3ba 100644 --- a/marshmallow_jsonschema/base.py +++ b/marshmallow_jsonschema/base.py @@ -287,7 +287,9 @@ def _from_nested_schema(self, obj, field): # If this is not a schema we've seen, and it's not this schema (checking this for recursive schemas), # put it in our list of schema defs if name not in self._nested_schema_classes and name != outer_name: - wrapped_nested = self.__class__(nested=True) + wrapped_nested = self.__class__( + nested=True, props_ordered=self.props_ordered + ) wrapped_dumped = wrapped_nested.dump(nested_instance) wrapped_dumped["additionalProperties"] = _resolve_additional_properties(