swagger-api / swagger-api/swagger-codegen

directory structure of swagger generated code is inappropriate.

Open
#3,383 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Android help wanted Issue: Bug
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Directory structure of swagger generated code is inappropriate, when the package name is supplied through config.json using -c option.

I have attached my swagger.yml file.

contents of config.json

{
"invokerPackage" : "in.lxltech",
"apiPackage" : "in.lxltech.krayon",
"modelPackage" : "in.lxltech.model"
}

The command i'm using to generated code:-

java -jar swagger-codegen-cli.jar generate -i swagger.yml -l android --library=volley -o generated_source_code -c config.json

swagger generated code directory structure

in
-lxltech
-krayon
-model

io
-swagger
-client
-auth => files inside this directory have package name as 'in.lxltech.auth' but the directory structure is incorrect
-request => files inside this directory have package name as 'in.lxltech.request' but the directory structure is incorrect

=> auth and request folders have to be placed under the directory 'in/lxltech', but it is placing under 'io/swagger/client'

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 by reproducing the command with config.json, swagger.yml, the android generator, and the volley library. Inspect how the generated auth and request packages are mapped to directories, then regenerate the client. Done means files whose packages are in in.lxltech.auth and in.lxltech.request are placed under the matching in/lxltech paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.