Handle Collection Type fields
See original GitHub issueFeature description:
Correctly handle fields such as List[str]
Curently when a field is of a collection type such as dict, list, Mapping, Sequence etc. the behaviour is broken.
For the model
class ExampleModel(BaseModel):
text: str
many_texts: Sequence[str]
the output is broken
and pressing the submit button results in the following error
Whoops! There were some problems with your input: many_texts: field required
Problem and motivation:
I have forms where some of the inputs are an arbitrary number of strings. Up until now I have solved this with a text_area widget, and prompt the user to separate their inputs with commas. Then with a custom validator the strings can be put back into a list. While this kinda works, it is a very hacky solution, it prevents me from using this package without breaking up my model
Is this something you’re interested in working on?
Currently I don’t have the capacity but it is something that am willing to look into in the near future (in a couple of months)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:8 (2 by maintainers)

Top Related StackOverflow Question
@LukasMasuch Just wanted to bump this as I am running into the issue as well. Any thoughts on a solution or workaround? I’d be happy to try to help contribute if you have ideas.
Great package btw!
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days