swagger-api / swagger-api/swagger-codegen

Use Swagger-Annotated Code As Input To swagger-codegen

Open
#5,694 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature General: Suggestion help wanted
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Feature Request: Enable swagger-codegen to generate a client API by inspecting a service's JAR/WAR for Swagger annotations.
As a RESTful service developer, I want to be able to generate and publish client JARs for my service as part of that service's build process. This will enable other developers to more easily integrate with my service. To accomplish this, I need to run swagger-codegen before the service is deployed and swagger.json is generated. I think the best approach is to have swagger-codegen inspect either my source files or compiled class files and use them as input.

Suggest a Fix

I have developed a Maven plugin that will scan a JAR file for Swagger annotations, generate swagger.json based on those annotations, then call swagger-codegen to generate a client API from the swagger.json. I was planning to release the plugin as a standalone OSS project, but then I thought it might make sense to contribute it as a new feature to this project.

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

No repository files, tests, or entry points are named. Review swagger-codegen's current input pipeline and the proposed Maven plugin workflow for scanning a service JAR/WAR for Swagger annotations before swagger.json exists; done means an agreed implementation can generate the service's client API during its build.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.