OpenAPITools / OpenAPITools/openapi-generator

Kotlin-spring generate default implementation with InterfaceOnly equals to true

Open
#6,792 5 comments 4 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.

I am using the generator kotlin-spring and I realised a missing functionality that java generators had.
OpenApiGenerate creates a default implementation for the methods, even that I had set up the option to interfaceOnly to be true or is there any other option that I can use?

Describe the solution you'd like

Ideally the endpotins should be created as abstract. The class that will implement the generated controller should be responsible of adding the required logic.

Describe alternatives you've considered

I cannot think another approach, but I have seen this pr related with the generator for java,
https://github.com/OpenAPITools/openapi-generator/pull/3022

Additional context

image

image

Any help or solution will be very appreciate.

Thanks

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 at the kotlin-spring generator's handling of interfaceOnly and compare it with the Java generator and PR #3022. Run generation with interfaceOnly=true against a representative OpenAPI specification, then verify that generated controller endpoints are abstract and implementation remains with the consuming class.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, openapi, spring
Domain
api, backend, 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.