Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

swagger-editor vs swagger-codegen

I am a newbie to swagger and I have been trying to develop api's using swagger-editor.

Swagger-codegen states that is an open source code-generator to build server stubs and client SDKs directly from a Swagger defined RESTful API.

When I work with swagger-editor I can see options :Generate server and Generate Client (I am running swagger-editor locally)

Does swagger-codegen have the same functionality as Generate server and Generate Client in swagger-editor or is there anything more to it ?

Thanks in advance.

like image 738
Sarageorge Avatar asked May 21 '18 07:05

Sarageorge


People also ask

What is difference between Swagger UI and Swagger editor?

Swagger Editor: Swagger Editor lets you edit OpenAPI specifications in YAML inside your browser and to preview documentations in real time. Swagger UI: Swagger UI is a collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from an OAS-compliant API.

What is Swagger codegen?

Swagger Codegen is an open source project which allows generation of API client libraries (SDK generation), server stubs, and documentation automatically from an OpenAPI Specification.

What is the Swagger editor?

The Swagger Editor is an open source editor to design, define and document HTTP-based and event-driven APIs using the OpenAPI and AsyncAPI specifications, respectively. Swagger Editor can be installed and run locally, or accessed on the Web.

What is the difference between Swagger and OpenAPI?

Although the terms once referred to the same thing, they can no longer be used interchangeably…even though some people still do. In 2021, OpenAPI refers to the industry-standard specification for RESTful API design. Swagger refers to a set of SmartBear tools.


1 Answers

Swagger Editor uses the online version of Swagger Codegen that is hosted at http://generator.swagger.io. There are other ways to run Swagger Codegen, for example:

  • download and use the command-line version (or build it yourself from the source code)
  • use the Docker image
  • call the online version http://generator.swagger.io directly

The main difference is that Swagger Editor calls the Codegen with the default options. If you want to customize the output, e.g. use a custom package name or custom codegen templates, you'll need to run the Codegen yourself.

like image 148
Helen Avatar answered Oct 20 '22 14:10

Helen