swagger-api / swagger-api/swagger-codegen

[scala] stripPackageName should be configurable

Open
#7,225 0 comments 0 reactions 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

See https://github.com/swagger-api/swagger-codegen/pull/7226 Pull Request

Needed because some APIs (e.g. Kubernetes) include version information in packages. Stripping causes many generated API and model classes to be named the same, causing a last-one-wins situation which is unacceptable.

  1. Version of swagger-codegen used: latest from master branch
  2. Language: scala
Steps to reproduce
  1. Example input spec to produce the problem: https://raw.githubusercontent.com/kubernetes-client/java/master/kubernetes/swagger.json
  2. In generated output, notice multiple versions from input spec have been lost due to package stripping.
Suggest a fix/enhancement

Make stripping package prefix optional.

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 with pull request 7226 and the Scala generator entry point that handles stripPackageName. Reproduce the issue with the linked Kubernetes swagger.json and inspect generated output across versioned packages. Done means package stripping can be disabled so version-specific API and model classes are not overwritten.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.