The goal of Swagger™ is to define a standard, language-agnostic interface to REST APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined via Swagger, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interfaces have done for lower-level programming, Swagger removes the guesswork in calling the service.
Use cases for machine-readable API interfaces include interactive documentation, code generation for documentation, client, and server, as well as automated test cases. Swagger-enabled APIs expose JSON files that correctly adhere to the Swagger Specification, documented in this repository. These files can either be produced and served statically, or be generated dynamically from your application.
Without going into a long history of interfaces to Web Services, this is not the first attempt to do so. We can learn from CORBA, WSDL and WADL. These specifications had good intentions but were limited by proprietary vendor-specific implementations, being bound to a specific programming language, and goals which were too open-ended. In the end, they failed to gain traction.
Swagger does not require you to rewrite your existing API. It does not require binding any software to a service--the service being described may not even be yours. It does, however, require the capabilities of the service be described in the structure of the Swagger Specification. Not all services can be described by Swagger--this specification is not intended to cover every possible use-case of a REST-ful API. Swagger does not define a specific development process such as design-first or code-first. It does facilitate either technique by establishing clear interactions with a REST API.
This GitHub project is the starting point for Swagger. Here you will find the information you need about the Swagger Specification, a simple static sample of what it looks like, and some general information regarding the project.
The current version of the Swagger specification is 2.0 - and you can find it here.
This repository contains the existing Swagger 1.2 specification as well as proposals for the 2.0 version.
Each section should contain v1.2 and v2.0 folders to avoid confusion between the versions.
Please keep in mind that the other projects under Swagger use an independent version system. As such, don't confuse the version of the Swagger Specification they support and the version of that given library. For example, Swagger-Core with the version 1.3.2 supports Swagger Specification 1.2.
Check out the wiki for additional and relevant information about the project.
This includes:
- Static sample tutorial.
- List of known deployments.
- Revision history.
If you just want to see it work, check out the pet store sample.
These are the projects that were created by the same people who authored the Swagger Specification:
- swagger-tools - A Node.js and browser module that provides tooling for validation and more around Swagger
- swagger-core - A Swagger implementation for Java/Scala. Has integration with JAX-RS (Jersey, Resteasy, CXF...), Servlets and Play Framework.
- swagger-js - A Swagger implementation for JavaScript.
- swagger-node-express - A Swagger module for node.js with express module.
- swagger-ui - A dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
- swagger-codegen - A template-driven engine to generate client code in different languages by parsing your Swagger documentation.
- swagger-editor - Swagger Editor lets you edit 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).
These are third party tools generated by the Swagger community. Note that not all are compatible with Swagger V2.0.
- octohipster - A hypermedia REST HTTP API library for Clojure.
- ring-swagger - Swagger implementation for Clojure/Ring using Prismatic Schema for data models
- compojure-api - Swagger for Compojure
- fnhouse-swagger - Swagger for fnhouse
- pedestal-swagger - Swagger for pedestal
- swagger1st - A Clojure/Ring handler that does parsing, validation and routing based on swagger definitions.
- swagger-docs-cfml - create swagger docs from CFML (Railo) ReST components.
- swagger - Swagger protocol implementation in Eiffel.
- go-restful - library to build REST based Web Services using Google Go.
- Sashay - a Go code generator for REST services that expose a Swagger specification.
- beego - A framework support support auto generate swagger spec from comments
- Swagger spec generator - A swagger spec auto generator. Doesn't depends on any framework
- restapidoc - A simple RESTful API documentation plugin for the Grails web application framework.
- swaggydoc - Swagger Documentation for Grails Controllers. [Source]
- springfox - Integrates with Spring MVC with support for Swagger 1.2 and Swagger 2.0 spec.
- swagger4spring-web - Integration with Spring MVC.
- swagger-maven-plugin - Support Swagger Spec 2.0, integrate with JAX-RS & Spring MVC project, and easily generate
swagger.json
& a static document during build phase. - swagger-codegen-maven-plugin - A maven build plugin which allows the codegen project to be triggered for generating clients, etc. during the build process.
- swagger-jaxrs-doclet - A JavaDoc Doclet that can be used to generate a Swagger resource listing suitable for feeding to swagger-ui.
- swaggerj4 - A parsing library to turn swagger specifications into POJOs.
- dropwizard-swagger - A dropwizard bundle that wraps Swagger-Core.
- swaggerapi - Creates a Swagger resource listing suitable for feeding to swagger-ui by annotating your classes and methods and handles API calls to those methods
- swagger-validator - Validates that definitions in a swagger.yaml match the actual Java code.
- swagger2markup - Swagger2Markup converts a Swagger JSON or YAML file into AsciiDoc or Markdown documents which can be combined with hand-written documentation. The AsciiDoc documents can be converted into HTML5, PDF and EPUB. The Swagger2MarkupConverter supports the Swagger 1.2 and 2.0 specification.
- swagger2markup-gradle-plugin - A Swagger2Markup Gradle Plugin which converts a Swagger JSON or YAML file into AsciiDoc or Markdown documents which can be combined with hand-written documentation. The AsciiDoc documents can be converted into HTML5, PDF and EPUB.
- assertj-swagger - assertj-swagger is a library which compares a design-first Swagger YAML with an implementation-first Swagger JSON output (e.g. from springfox). assertj-swagger allows to validate that the implementation in compliance with the design specification.
- swagger-ajax-client - Swagger client to communicate with a Swagger server using XHR requests from browsers. Includes client-side validation of requests against the given Swagger spec.
- swagger-angular-client - Angular service Swagger client to communicate with a Swagger server using the Angular-specific services (such as $http). Includes client-side validation of requests against the given Swagger spec.
- swagger-client-generator - Client library generator which can be used to create framework or platform-specific Swagger clients given a transport method (e.g. swagger-angular-client or swagger-node-client).
- swagger-validate - Validation utility to validate Swagger models or requests against a given spec, useful for writing Swagger client libraries.
- Swagger Parser - Parses, validates, and dereferences JSON/YAML Swagger specs in Node and browsers
- ServiceStack - a high-performance .NET web services platform that simplifies the development of high-performance REST (JSON, XML, JSV, HTML, MsgPack, ProtoBuf, CSV) and WCF SOAP Web Services. Has support for Swagger integration.
- fubumvc-swagger - This project helps your FubuMVC web application generate API documentation via Swagger.
- Swashbuckle - Adds some Swagger to your WebApi.
- Swagger.Net - Library to document the ASP.NET Web API using the Swagger specification.
- dotswaggen - .Net application that generates code (or anything else, e.g. markdown) from a swagger specification file.
- AutoRest - The AutoRest tool generates client libraries for accessing RESTful web services from a Swagger specification.
- Swagger Framework - a module for creating Swagger-based apis using the standard HTTP request listener interface (including Express). It supports request normalization/validation, pluggable consumes/produces, spec validation, and more.
- swagger-jack - Express middleware to automatically create route and validate inputs from a swagger descriptor (for NodeJS).
- hapi-swagger - A Swagger interface for HAPI.
- hapi-swaggered - A hapi.js plugin to generate swagger v2.0 compliant specifications based on hapi routes and joi schemas.
- Swagger Validation - A library to validate a request that integrates with swagger-node-express.
- swagger-node-client - Node client to communicate with Swagger servers. Includes detailed client-side validation against the API spec.
- swaggerize-express - Design-driven RESTful apis with swagger and express from @PayPalDev.
- swaggerize-hapi - Design-driven RESTful apis with swagger and hapi from @PayPalDev.
- generator-swaggerize - Yeoman generator for krakenjs/swaggerize tools from @PayPalDev.
- a127 - a127 is toolkit for modeling & building rich, enterprise-class APIs in Node.js on your laptop. The focal point of a127 is the Swagger 2.0 specification for defining and describing an API model. From the Swagger model you can generate clients, servers and interactive documentation for your API. From @apigee
- ratify - A Hapi plugin that automatically creates Swagger documentation AND validates request/response parameters using the JSON Schema spec.
- swagger-tools - Various Swagger tools for JavaScript including an API/CLI (conversion, validation, ...) and Connect middleware for routing, validation, security and swagger-ui.
- swagger-express - A simple and clean solution to integrate swagger with express straight away from jsdoc or a yaml file.
- Swagger Parser - Parses, validates, and dereferences JSON/YAML Swagger specs in Node and browsers
- Swagger Express Middleware - Swagger middleware and mocks for Express.js
- swagger-mongodb - lightweight swagger-ui crud-api backed by mongodb
- Raisin - A framework with a built-in Swagger support.
- Swagger-PHP - a library implementing the swagger.io specification to describe web services, operations/actions and models enabling a uniform means of producing, consuming, and visualizing RESTful web services.
- NelmioApiDocBundle - A Symfony Bundle.
- Restler - PHP framework, swagger support in 3.0.
- swagger-assert - enable to assert keys in swagger document and API response
- SwaggerAssertions - Swagger 2 test assertions for validate your API requests and responses
- Swaggervel - a package for Laravel that uses Swagger-PHP and swagger-ui to auto-generate docs for your project.
- django-rest-swagger - Swagger Documentation Generator for Django REST Framework
- django-tastypie-swagger - An adapter to use Swagger with django-tastypie.
- flask-restful-swagger - A Swagger spec extractor for flask-restful.
- pyramid-swagger - Convenient tools for using Swagger to define and validate your interfaces in a Pyramid webapp.
- flask-restplus - Helpers, syntaxic sugar and Swagger documentation for Flask-Restful
- pyswagger - A type-safe, dynamic, spec-compliant Swagger client.
- flex - Swagger 2.0 schema validation, and tooling for validating arbitrary request/response objects.
- flask-swagger - A Swagger 2.0 extractor for Flask via YAML in docstrings
- bravado - Swagger 2.0 client with support for both synchronous and asynchronous http.
- bravado-core - Library for Swagger 2.0 schema ingestion, validation, request/response validation, etc.
- swagger-spec-validator - Library for validating Swagger 1.2 and 2.0 schemas.
- grape-swagger - Add Swagger compliant documentation to your grape API.
- swagger-docs - Generates Swagger files for Rails APIs with a simple DSL.
- swagger-blocks - Define and serve live-updating Swagger JSON for Ruby apps.
- source2swagger - Builds a swagger compliant JSON specification from annotations on the comments of your source code.
- swagger_engine - include Swagger-ui as mountable rails engine.
- Scalatra - see the Swagger Guide
- spray-swagger - Spray-Swagger brings Swagger support for Spray Apis.
- Api-doc - Creates swagger docs from easily readable ascii text placed in the code. Depends on playframework, but may also be used in other frameworks.
These are third party tools generated by the Swagger community:
- gform-admin - An alternative UI client for Swagger.
- swagger-cli-client - Command-line interface generator to communicate with Swagger servers.
- swagger.ed - A Chrome extenstion that will change the way you look at APIs.
- Swagger2Postman - Creates a Postman collection from live Swagger documentation
Copyright 2014 Reverb Technologies, Inc.
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.