Open sebarys opened 2 years ago
Other finding:
for byteBufferBody
when I provided example value
.out(
byteBufferBody.example(Example.of(ByteBuffer.wrap(SampleExportContent.getBytes)))
and header("Content-Type", "text/csv")
)
generated openapi example is java.nio.HeapByteBuffer[pos=0 lim=2018 cap=2018]
, not provided, stringified value
responses:
'200':
description: ''
headers:
Content-Type:
required: true
schema:
type: string
content:
text/csv:
schema:
type: string
format: binary
example: java.nio.HeapByteBuffer[pos=0 lim=2018 cap=2018]
for byteBufferBody when I provided example value
This should be a separate issue - can you open one? Also, what would you expect to be visible in the example section?
sure @adamw : https://github.com/softwaremill/tapir/issues/2256
Hi :)
Like we discussed on Tapir gitter it would be desirable for some use cases to have a way to cleanup/remove file provided as response body to an endpoint that declare
out
asfileBody
, e.g. export endpoint that create temporary file that is no longer needed after an endpoint returned response.Currently the only way that I managed to implement e2e is either:
.out(byteBufferBody and header("Content-Type", "text/csv"))
More context in this gitter thread: https://gitter.im/softwaremill/tapir?at=629dc6c4c61b987d33e59c2e