Skip to content

[BUG] Java client (OkHttp) uses java.io.File for file parameters, instead of an InputStream #7941

@Cloudmersive

Description

@Cloudmersive

Bug Report Checklist

There is a serious design flaw in the Java client generated by default. Open to workarounds, have not been able to find one so far.

Description

Currently, if you have a binary string input parameter, the generated client takes a parameter of java.io.File. This is wrong because it means that you can only pass in a "local file" as a parameter. You cannot pass in a memory stream, which would be the more common case.

There does not seem to be an option to configure this, thus rendering the generated client completely useless for APIs that take in binary string / file parameter types. This is a huge issue. Would love to know if there is a workaround.

openapi-generator version

openapi-generator-cli-5.0.0-beta2.jar

OpenAPI declaration file content or url

https://api.cloudmersive.com/swagger/api/convert

Generation Details

See above

Steps to reproduce

See above

Related issues/PRs

N/A

Suggest a fix

Offer an option to use InputStream

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