OpenAPITools / OpenAPITools/openapi-generator

[REQ] Feature Request Description

Open
#15,129 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

Yes, I would need to support "application/octet-stream" in the Swift generator.

Describe the solution you'd like

  1. In URLSessionRequestBuilder.execute(), check if contentType.hasPrefix("application/octet-stream") and initialize OctetStreamEncoding()
  2. Create a new OctetStreamEncoding class
  3. Duplicate FormURLEncoding content and replace "application/x-www-form-urlencoded" by "application/octet-stream" to OctetStreamEncoding

Describe alternatives you've considered

Override URLSessionRequestBuilder.execute() but it will duplicate too many lines

Additional context

I need to be able to upload a file into a server accepting only content-type: "application/octet-stream"

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 in the Swift generator at URLSessionRequestBuilder.execute() and inspect the existing FormURLEncoding implementation. Add the requested OctetStreamEncoding support for application/octet-stream and verify that generated clients can upload files to servers requiring that content type.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.