ninadphalak
4 years agoNew Member
How to generate only ResponseEntity?
I want to return a response that is either a byte[] array or a list of POJO. For that I want to return a ResponseEntity object without specifying a type. I'm generating the Api using openApi, I have tried various combinations to no avail.
The closest I got was to generate ResponseEntity. Or to generate either ResponseEntity<List> OR ResponseEntity<byte[]>.
Is there a way to generate this using OpenApi?
What I have tried so far:
responses:
"200":
description: "Success"
content:
# application/json:
# schema:
# type: array
# items:
# $ref: "#/components/schemas/Employee"
# application/avro:
# schema:
# type: string
# format: byte
I want to have a return type of only ResponseEntity so that I can return byte[] array or List of Employees from the same api.