Skip to content

[BUG] CSharp code generator logic error #21384

@lld1995

Description

@lld1995

I got boundary loss response when formdata and i check the generation code, i saw these code
`string[] contentTypes = new string[] {
"multipart/form-data"
};

string contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes);

if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null)
httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar);`

It reset the MultipartContent's ContentType ,but MultipartContent auto generate boundary in it and had set boundary.It causes boundary loss in ContentType.

Verison:
openapi-generator-cli 7.14.0-SNAPSHOT
commit : 5677f5b
built : -999999999-01-01T00:00:00+18:00
source : https://github.com/openapitools/openapi-generator
docs : https://openapi-generator.tech/

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