Skip to content

Commit

Permalink
fix: handle required fields correctly when using data_key
Browse files Browse the repository at this point in the history
  • Loading branch information
jgroth committed Dec 12, 2019
1 parent bd2f0fb commit 4dde882
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion marshmallow_jsonschema/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def get_required(self, obj):

for field_name, field in sorted(obj.fields.items()):
if field.required:
required.append(field.name)
required.append(field.data_key or field.name)

return required or missing

Expand Down

0 comments on commit 4dde882

Please sign in to comment.