Skip to content

Support repeated key=value in form data #842

@ghost

Description

Is your feature request related to a problem

Yes.

Given some URL encoded data like this...

choices=parrot&choices=spider

...only the last key=value wins.

This does not work like I expected:

choices: list = Form(...)

You can only validate against the last value.

The solution you would like

Perhaps FastAPI should collect repeated keys in the 2-tuple list that request.form() gives and assign those values as a list to the same key before validation happens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions