OpenAPITools / OpenAPITools/openapi-generator

Kotlin delegate pattern should declare delegate parameter as nullable

Open
#6,857 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

https://github.com/OpenAPITools/openapi-generator/blob/21e285cea9a876a2ae30f5b22153e160dbcaca9f/modules/openapi-generator/src/main/resources/kotlin-spring/apiController.mustache#L14

Constructor declares autowired as required=false but parameter itself is not nullable, as I understand it should be nullable otherwise exception is rised when there is no implementation yet for delegate.

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 modules/openapi-generator/src/main/resources/kotlin-spring/apiController.mustache around line 14 and inspect the generated delegate constructor. Verify that the generated Kotlin parameter can represent an absent delegate and that generation no longer raises an exception when no delegate implementation exists.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
api
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.