Skip to content

Commit

Permalink
Move responsibility of setting nullable property
Browse files Browse the repository at this point in the history
  • Loading branch information
dexter2206 committed Jun 25, 2018
1 parent aca99fe commit 6165ce9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nadia/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def translate_args(spec, **kwargs):
:rtype: dict
"""
return {
'allow_none': kwargs.get('nullable', False),
'allow_none': spec.get('nullable', False),
'required': kwargs.get('required', False)
}

Expand Down
3 changes: 1 addition & 2 deletions nadia/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ def construct_attributes_schemas(self, spec):
attr_required = prop_name in spec.get('required', [])
attr_schemas[prop_name] = attr_schemas_builder.build_schema(
prop_content,
required=attr_required,
nullable=prop_content.get('nullable', False))
required=attr_required)
return attr_schemas

@staticmethod
Expand Down

0 comments on commit 6165ce9

Please sign in to comment.