Skip to content

Commit a03b188

Browse files
committed
fix: BaseObj.merge exception for AdditionalPropertiesContext
#51 The right way to check if a Context containing generated BaseObj is by calling “is_produced” of Context, not by comparing None.
1 parent 7fc327c commit a03b188

5 files changed

Lines changed: 8660 additions & 3 deletions

File tree

pyswagger/scanner/v2_0/aggt.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def _compose(obj, guard=None):
2626
_compose(v, guard)
2727

2828
final = Schema(NullContext())
29-
final.update_field('additionalProperties', obj.additionalProperties)
3029
final.merge(obj, SchemaContext)
3130

3231
# those 'allOf' are visited by the last CycleGuard,

pyswagger/spec/v2_0/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def is_produced(kls, obj):
8383
def produce(self):
8484
"""
8585
"""
86-
if self._obj != None:
86+
if self.is_produced(self._obj):
8787
return self._obj
8888
else:
8989
return AdditionalPropertiesContext._TmpObj(self)

0 commit comments

Comments
 (0)