Hi everyone!
I have a POST endpoint that is able to receive `application/json' and 'application/gzip' in the body (and it works), but the OpenAPI request body does not know how to match them to the correct type.
This is an example:
class Payload { content: string; }
@Controller({
path: 'test',
version: '1',
})
export class TestController {
@Post('/maybe-zip')
@ApiOperation({ summary: 'Test controller', })
@ApiBody({ type: Payload || Buffer })
@ApiConsumes('application/json', 'application/gzip')
async test(@Body() body: Payload | Buffer): Promise<void> {
// content
}
}
The output OpenAPI json:
{
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Payload"
}
},
"application/gzip": {
"schema": {
"$ref": "#/components/schemas/Payload"
}
}
}
}
}
Is there a way to match application/gzip to Buffer?