Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Array parameter in multipart/form-data does not explode when it's part of a complex object #3169

Open
FlameWolf opened this issue Nov 23, 2024 · 1 comment
Labels

Comments

@FlameWolf
Copy link

Describe the bug

When the request body is multipart/form-data, and it contains an array parameter which is part of a complex object, the array parameter does not explode, but instead the value is sent as a comma-separated list.

Expected behavior

An array parameter should be sent as multiple form fields having the same name even when it is not a direct parameter of an operation but included as part of a complex object.

Actual behavior

Value of the array parameter is sent as a comma-separated list.

Steps to reproduce

  1. Clone the repo https://github.com/FlameWolf/DotNet9WebApi
  2. Comment out line #30 in Program.cs:
    options.OperationAsyncFilter<SwaggerArrayParameterFilter>();
    
  3. Run the application and try out the endpoint /WeatherForecast/post
  4. Uncomment line #30 in Program.cs to see the expected behaviour

Exception(s) (if any)

No response

Swashbuckle.AspNetCore version

7

.NET Version

9

Anything else?

No response

@FlameWolf FlameWolf added the bug label Nov 23, 2024
@martincostello
Copy link
Collaborator

Related to #3065.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants