OpenAPITools / OpenAPITools/openapi-generator

[BUG] multipart/form-data in Swift URL instead of Data

Open
#15,871 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

This part:


"requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "Trekk": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },

generates

open class func adventuresUploadTrackWithRequestBuilder(id: String, trekk: URL? = nil) -> RequestBuilder<String> {///}
and then inside that it generates


let localVariableFormParams: [String: Any?] = [
            "Trekk": trekk?.encodeToJSON(), // json?
        ]

Adding --global-property skipFormModel=false does not do anything.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the Swift operation entry point adventuresUploadTrackWithRequestBuilder and reproduce the multipart/form-data example with skipFormModel=false. Trace how the binary Trekk field is represented in the generated request, then verify that the generated client uses the expected data type and form encoding instead of URL JSON encoding.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, swift
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.