Skip to content

Repeated field names get overriden by the last one #23

Description

@RonnieWinter

I have a form where I have 3 input fields with the name attribute 'departureAirports'.
I only set the first one and leave the second and third empty.
When I inspect the parsed data from aws-lambda-multipart-parser, I see that departureAirports if empty and was overridden by the third departure airport.

I think the proper functionality should be, parse the first and if there are more fields with the same name, make the object attribute into a list, and push every subsequent value for the repeated fields.

So if I had the following multipart data:
departureAirports: 'JFK'
departureAirports: 'LAX'
departureAirports: ''

I should get this as the parsed data:

{
    departureAirports: ['JFK', 'LAX', '']
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions