Skip to content

Commit

Permalink
Fixed array with no subfield
Browse files Browse the repository at this point in the history
  • Loading branch information
trollfot committed Jun 6, 2023
1 parent e883dd4 commit 71576f8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/jsonschema_colander/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,13 @@ def get_widget(self, factory, options):
def __call__(self):
factory = self.get_factory()
options = self.get_options()
subfield = self.subfield()
if not subfield.name:
subfield.name = 'item'
return factory(subfield, **options)
if self.subfield is not None:
subfield = self.subfield()
if not subfield.name:
subfield.name = 'item'
return factory(subfield, **options)
widget = self.get_widget(factory, options)
return colander.SchemaNode(factory(), widget=widget, **options)

@classmethod
def extract(cls, params: Mapping, available: set):
Expand Down

0 comments on commit 71576f8

Please sign in to comment.