swagger-api / swagger-api/swagger-codegen

[Kotlin-Client] Model-Suffix and Model-Prefix not working

Open
#9,288 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

When generating code for language 'kotlin-client' the model-suffix and model-prefix parameters are not applied.

If I change the language from 'kotlin-client' to e.g. 'java' the model suffix is applied correctly.

Swagger-codegen version
  • 3.0.5 (tested and not working with language: kotlin-client and kotlin-server)
  • 2.4.2 (tested and not working with language: kotlin)
Swagger declaration file content or url
http://petstore.swagger.io/v2/swagger.json
Command line used for generation
swagger-codegen generate -l kotlin-client -i http://petstore.swagger.io/v2/swagger.json -Dmodels --model-name-suffix DTO
Steps to reproduce

No further steps needed for reproducing. The command from above already produces the buggy models that miss the DTO suffix.

Related issues/PRs
Suggest a fix/enhancement

Adjust model-name logic to be the same as in the java generator.

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

Run the reported swagger-codegen command against the Petstore Swagger document and compare kotlin-client and kotlin-server output with the Java generator. Trace the Kotlin model-name logic and compare it with the Java generator's handling of model-name-suffix and model-name-prefix. Done means generated Kotlin model names include the requested DTO suffix or prefix.

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
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.