Skip to content

[BUG][CSHARP][RESTSHARP] Enum array inside multipart/form-data request bug #21538

Open
@kipusoep

Description

@kipusoep
Description

I have this endpoint which requires the content type to be multipart/form-data because of a file upload.
One of the other properties in the body is of type enum array.
Currently this is being generated:

localVarRequestOptions.FormParameters.Add("EnumArrayItems", MyNamespace.Api.Client.ClientUtils.Serialize(enumArrayItems)); // form parameter

It should generate this instead:

foreach (var enumArrayItem in enumArrayItems)
{
    localVarRequestOptions.FormParameters.Add("EnumArrayItems", MyNamespace.Api.Client.ClientUtils.ParameterToString(enumArrayItem)); // form parameter
}
openapi-generator version

OpenAPI Generator 7.14.0

OpenAPI declaration file content or url

https://gist.github.com/kipusoep/5070a52cb53537f5713ee83a41b210c2

Generation Details

I am using the REST API Client Code Generator v1.29.0.0 Visual Studio plugin to generate the code.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions