Skip to content

MultiPartBody: Impossible to add multiple Body Parts with the same name #568

@wim-kaspar

Description

@wim-kaspar

First of: I know an issue with this exact title exists, but it is not solved in my opinion. (I added a comment but cannot reopen it)

What are you generating using Kiota, clients or plugins?

API Client/SDK

In what context or format are you using Kiota?

Nuget tool

Client library/SDK language

Csharp

Describe the bug

I am using an existing API with the Atteached API Spec.

In the previous issue the user faced the same issue with multiple files with the same name. It was then solved by adding the filename as descriminator. However, I don't have a file name to use.

I think the underlying type of form data has to change from a dictionary to a list for this to work.

Expected behavior

Be able to create a multipart body with multiple elements with the same name.

How to reproduce

Generate client with attached API spec.

Try add multiple values for multiValue

Open API description file

openapi: 3.0.3
info:
  title: Poc
  version: 0.0.1
paths:

  '/api/multipart':
    post:
      operationId: postFileAndData
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                singleValue:
                  type: integer
                multiValue:
                  type: array
                  items:
                    type: string
      responses:
        201:
          description: created

Kiota Version

1.28.0+57130b1b1db3bc5c060498682f41e20c8ae089f2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Needs Triage 🔍

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions