JavaScript HTML Other
Permalink
Failed to load latest commit information.
.github housekeeping: remove Q&A section from feature template (#1825) Jul 9, 2018
build-tools fix(docker-releases): trim leading `v` from image names (#1759) May 17, 2018
dev-helpers Add favicons to dev-server html, for consistency Jun 29, 2017
dist rebuild dist Aug 4, 2018
docs feature: `getEditorMetadata` helper (#1789) Jun 12, 2018
src fix(autosuggest): double-escape Responses digit regex mask (via #1866) Aug 15, 2018
swagger-editor-dist-package Correct path for swagger-editor.js Nov 25, 2017
test add jsdom to tests Aug 4, 2018
.agignore Add agignore for searching Jun 15, 2017
.babelrc Feature/add unit test to editor (#1764) Jun 27, 2018
.editorconfig Create .editorconfig Mar 21, 2017
.eslintrc fix: missing production dependencies (#1820) Jul 4, 2018
.gitignore Remove package-lock.json Jun 10, 2017
.npmignore Add travis config Mar 19, 2017
.travis.yml Update .travis.yml (#1828) Jul 10, 2018
Dockerfile `ico` -> `png` (#1694) Mar 10, 2018
LICENSE Happy new year 🎉 Jan 2, 2018
README.md docs: README touchups (#1772) May 29, 2018
docker-run.sh added docker files Apr 11, 2017
index.html Fixes #1295 - Add favicon to index.html file Jun 29, 2017
make-webpack-config.js v3.6.1 (#1811) Jun 30, 2018
nginx.conf added docker files Apr 11, 2017
package.json add jsdom to tests Aug 4, 2018
webpack-dist-bundle.config.js Add Editor polyfill structure and Object.values polyfill Jun 28, 2017
webpack-dist.config.js Add Editor polyfill structure and Object.values polyfill Jun 28, 2017
webpack-hot-dev-server.config.js Make the dev server great again Nov 9, 2017
webpack-standalone.config.js Add Editor polyfill structure and Object.values polyfill Jun 28, 2017
webpack.check.js in with the new Mar 19, 2017
webpack.config.js in with the new Mar 19, 2017

README.md

Swagger Editor

NPM version Build Status Code Climate Dependency Status devDependency 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, Edge and IE11.

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.

License

Copyright 2018 SmartBear Software

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.