softwaremill / softwaremill/tapir

[Feature request] cleanup fileBody after successful response

Open
#2,182 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
1.5k
Forks
468
Avg merge
5h 37m
Merged PRs (30d)
34

Description

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 as fileBody, 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:

More context in this gitter thread: https://gitter.im/softwaremill/tapir?at=629dc6c4c61b987d33e59c2e

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the fileBody response path with the linked adopt-tapir StarterApi.scala example, and review how the endpoint's out("fileBody") response is handled. The change is complete when a temporary file can be removed after a successful response without requiring callers to convert it to a byte stream or manage cleanup explicitly.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.