swagger-api/swagger-codegen

Use Swagger-Annotated Code As Input To swagger-codegen

Open

#5694 opened on May 23, 2017

View on GitHub
 (5 comments) (0 reactions) (0 assignees)HTML (12,701 stars) (5,474 forks)batch import
Enhancement: FeatureGeneral: Suggestionhelp wanted

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