OpenAPITools / OpenAPITools/openapi-generator

[BUG][KOTLIN] Generator printing warnings for type-mapped class

Open
#7,287 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

I'm trying to generate Kotlin code using a mapped type Feature that I want to provide. The generated code looks correct, but the plugin prints a warning line:

Unknown type found in the schema: Feature

Am I configuring something incorrectly and that line can go away?

I have a minimal example at https://github.com/andrewparmet/test-openapi-kotlin-type-mapping.

My config, in particular for type mappings:
https://github.com/andrewparmet/test-openapi-kotlin-type-mapping/blob/master/build.gradle.kts#L17-L18

In fact, I can remove those two lines altogether or include one or the other and nothing changes. My impression from the documentation is that I want them and they should be responsible for this warning. Is there something I'm missing?

openapi-generator version

4.3.1

OpenAPI declaration file content or url

https://github.com/andrewparmet/test-openapi-kotlin-type-mapping/blob/master/src/main/resources/test-api.yaml

Generation Details

Gradle plugin.

Steps to reproduce

./gradlew build in the directory of the attached project.

Suggest a fix

I can ignore this warning since the generated code is correct, but I want to see if it can be removed.

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

Reproduce the warning with ./gradlew build in the linked minimal project. Inspect build.gradle.kts lines 17-18 and src/main/resources/test-api.yaml, then trace how the Kotlin generator handles the mapped Feature type; done means the warning is removed while generated code remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.