swagger-editor

Swagger编辑器。(Swagger Editor)

Github星跟蹤圖

NPM version
Build Status
Code Climate
Dependency Status
devDependency Status
Build Status

?️ Looking for the older version of Swagger Editor? Refer to the 2.x branch.

Swagger Editor lets you edit Swagger API specifications in YAML inside your browser and to preview documentations in real time.
Valid Swagger JSON descriptions can then be generated and used with the full Swagger tooling (code generation, documentation, etc).

As a brand new version, written from the ground up, there are some known issues and unimplemented features. Check out the Known Issues section for more details.

This repository publishes to two different NPM modules:

  • swagger-editor is a traditional npm module intended for use in single-page applications that are capable of resolving dependencies (via Webpack, Browserify, etc).
  • swagger-editor-dist is a dependency-free module that includes everything you need to serve Swagger Editor in a server-side project, or a web project that can't resolve npm module dependencies.

If you're building a single-page application, using swagger-editor is strongly recommended, since swagger-editor-dist is significantly larger.

For the older version of swagger-editor, refer to the 2.x branch.

Running locally

Prerequisites
  • Node 6.x
  • NPM 3.x

If you have Node.js and npm installed, you can run npm start to spin up a static server.

Otherwise, you can open index.html directly from your filesystem in your browser.

If you'd like to make code changes to Swagger Editor, you can start up a Webpack hot-reloading dev server via npm run dev.

Browser support

Swagger Editor works in the latest versions of Chrome, Safari, Firefox, and Edge.

Known Issues

To help with the migration, here are the currently known issues with 3.X. This list will update regularly, and will not include features that were not implemented in previous versions.

  • Everything listed in Swagger UI's Known Issues.
  • The integration with the codegen is still missing.
  • Importing specs from a URL is not implemented.

Docker

Running the image from DockerHub

There is a docker image published in DockerHub.

To use this, run the following:

docker pull swaggerapi/swagger-editor
docker run -d -p 80:8080 swaggerapi/swagger-editor

This will run Swagger Editor (in detached mode) on port 80 on your machine, so you can open it by navigating to http://localhost in your browser.

Building and running an image locally

To build and run a docker image with the code checked out on your machine, run the following from the root directory of the project:

# Install npm packages (if needed)
npm install

# Build the app
npm run build

# Build an image
docker build -t swagger-editor .

# Run the container
docker run -d -p 80:8080 swagger-editor

You can then view the app by navigating to http://localhost in your browser.

Documentation

Security contact

Please disclose any security-related issues or vulnerabilities by emailing security@swagger.io, instead of using the public issue tracker.

主要指標

概覽
名稱與所有者swagger-api/swagger-editor
主編程語言JavaScript
編程語言JavaScript (語言數: 6)
平台Linux, Mac, Windows
許可證Apache License 2.0
所有者活动
創建於2014-05-02 22:47:10
推送於2025-04-21 16:01:53
最后一次提交2025-03-19 08:39:08
發布數537
最新版本名稱v5.0.0-alpha.101 (發布於 )
第一版名稱v2.0.6 (發布於 2014-08-19 12:20:23)
用户参与
星數9.1k
關注者數260
派生數2.3k
提交數4.9k
已啟用問題?
問題數2014
打開的問題數256
拉請求數2672
打開的拉請求數9
關閉的拉請求數705
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?