Skip to content

[BUG][JAVA] Issue generating proper response type for file #11603

@nikhil-ojha-by

Description

@nikhil-ojha-by
Description

I am using openapi-generator gradle plugin with version "5.2.1" to generate api from openApi spec 3.0.
In one of the endpoint I have to return file as a response (.xls file), I have given the response content-type in openApi spec as shown below:-

/files/template:
    get:
      operationId: abc
      summary: Returns  file in .xls format
      tags:
        - abc
      responses:
        200:
          description: The Contracted Rates Template file
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary

And I want the response type as ResponseEntity<Resource> but instead openApi generator generates ResponseEntity<MultipartFile>
Please help!

openapi-generator version

openapi-generator version -> 5.2.1

OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix

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