OpenAPITools / OpenAPITools/openapi-generator

[REQ][Finch] Add Cats option to Finch server codegen

Open
#2,902 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature General: Suggestion Hacktoberfest help wanted Server: Scala
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.

In order to use the Scala library Cats, endpoint code generation for the Finch library is different. For example, while ordinary Finch usage defines an endpoint of the type Endpoint[io.circe.Json], we can also explicitly invoke the IO monad with Endpoint[cats.effect.IO, io.circe.Json] (full package names added for context, they would normally just be imported). The code within the endpoint would also look different.

Describe the solution you'd like

We should provide an option to allow an explicit cats.effect usage of Finch, for those users who have services and other downstream dependencies wrapped with cats-style code.

Describe alternatives you've considered

I've considered making a private library, or creating a new public generator. An option with the existing Finch code generator would be preferable.

Additional context

For example
openapi-codegen generate -i [file] -l finch --cats -o /tmp/test/

I'm not sure whether this is available for v2.

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 locating the Finch server generator and checking how generator options are handled, then verify whether v2 has existing Cats support. Implement the requested --cats option so generated Finch endpoints can use cats.effect.IO, and validate it with the example command from the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
api, backend-api-design
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.