swagger-api / swagger-api/swagger-codegen
The files and directory structures output into generated-sources by swagger-codegen-maven-plugin are unusable
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Similar code generator plugins for SOAP, Thrift, WADL, etc. output the sources directly into /target/generated-sources/wsimport/. The contents of this directory is source code and package directories only; nothing else.
When swagger-codegen-maven-plugin is executed, it outputs a complete Maven project directory structure and build files into /target/generated-sources/swagger/. When Maven gets to the compile phase, the source files are not found and the build fails.
What gets generated by swagger-codegen-maven-plugin:
\---target
+---generated-sources
| \---swagger
| | build.gradle
| | gradle.properties
| | pom.xml
| | README.md
| | settings.gradle
| |
| \---src
| \---main
| | AndroidManifest.xml
| |
| \---java
| \---io
| \---swagger
| \---client
| | ApiClient.java
| | ApiException.java
| | Configuration.java
| | JSON.java
| | Pair.java
| | StringUtil.java
| |
| +---api
| | PetApi.java
| | StoreApi.java
| | UserApi.java
| |
| +---auth
| | ApiKeyAuth.java
| | Authentication.java
| | HttpBasicAuth.java
| | OAuth.java
| | OAuthFlow.java
| |
| \---model
| ApiResponse.java
| Category.java
| Order.java
| Pet.java
| Tag.java
| User.java
What it should be generating to be usable:
\---target
+---generated-sources
| \---swagger
| \---io
| \---swagger
| \---client
| | ApiClient.java
| | ApiException.java
| | Configuration.java
| | JSON.java
| | Pair.java
| | StringUtil.java
| |
| +---api
| | PetApi.java
| | StoreApi.java
| | UserApi.java
| |
| +---auth
| | ApiKeyAuth.java
| | Authentication.java
| | HttpBasicAuth.java
| | OAuth.java
| | OAuthFlow.java
| |
| \---model
| ApiResponse.java
| Category.java
| Order.java
| Pet.java
| Tag.java
| User.java
When I move and delete files by hand I can get it to compile, package and run successfully.
IMO the swagger-codegen-maven-plugin is unusable in its current form.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the swagger-codegen-maven-plugin generation entry point and compare its current target/generated-sources/swagger layout with the expected layout in the issue. Verify the generated Java sources are directly under target/generated-sources/swagger and that Maven can compile, package, and run the project without manual file moves or deletions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100