OpenAPITools / OpenAPITools/openapi-generator

[REQ] Tapir for scala support

Open
#11,264 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

Scala has a lot of http server and client libraries as a consequence there now is a library called 'tapir' to do endpoint descriptions.
The tapir library than has support for the most common http libraries.
It is from the same authors as 'sttp'.

Describe the solution you'd like

I think it would be best to support scala-tapir and anyone who want to then use any another scala http libary can use the tapir http enpoint descriptions. So we don't have to create more and more scala based generators.

Additional context

As a proof of concept i started from the sttp generator and changed it to generate tapir code, I still have to implement the return types.
Multipart bodies and alternative content types are not supported yet.
https://github.com/borissmidt/openapi-generator/blob/tapir-support/samples/client/petstore/scala-tapir/src/main/scala/org/openapitools/client/api/PetApi.scala

Contributor guide

Open the contributing guide

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 reviewing the existing sttp-based generator and the sample at samples/client/petstore/scala-tapir/src/main/scala/org/openapitools/client/api/PetApi.scala. Compare the proof of concept with the generator's expected output, then determine how return types, multipart bodies, and alternative content types should be represented. Done means Tapir support generates usable code for these cases.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.