GithubHelp home page GithubHelp logo

vineey / angular-swagger-ui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from orange-opensource/angular-swagger-ui

1.0 0.0 0.0 205 KB

An angularJS implementation of Swagger UI

Home Page: http://orange-opensource.github.io/angular-swagger-ui/

License: MIT License

JavaScript 60.58% CSS 23.14% HTML 16.27%

angular-swagger-ui's Introduction

angular-swagger-ui

angular-swagger-ui is an angularJS implementation of Swagger UI

Swagger helps you documenting your RESTful API.

Swagger UI helps developers discovering your RESTful API by providing an online documentation with an integrated API explorer.

Warning

Only Swagger 2.0 is supported

application/xml is not supported

Authentication is not implemented, please use 'api-explorer-transform' directive's param to customize API calls

###Updates

application/xml is now supported

see https://github.com/vineey/angular-swagger-ui/blob/master/CHANGELOG.md for more information

Quick Start

Install

bower install angular-swagger-ui --save

Dependencies

  1. angularJS
  2. bootstrap CSS

Demo

A builded version of the angular-swagger-ui is available at this address:

http://orange-opensource.github.io/angular-swagger-ui

License

All code in this repository is covered by the MIT license. See LICENSE file for copyright details.

Getting Started

Include angular-swagger-ui as a dependency into your application

<script type="text/javascript">
	angular.module('yourApp', ['swaggerUi']);
	...
</script>

Create an HTML element in your angularJS application's template or in your HTML page

<div swagger-ui url="URLToYourSwagger" api-explorer="true"></div>

Add swagger-ui.min.js and angular.min.js to the end of the body

<body>
 	...
 	<script src="yourPathToAngularJS/angular.min.js"></script>
 	<script src="yourPathToAngularSwaggerUI/dist/scripts/swagger-ui.min.js"></script>
</body>

Add swagger-ui.min.css and bootstrap.min.css to the head of the HTML page

<body>
	<head>
		...
		<link rel="stylesheet" href="yourPathToBootstrapCSS/bootstrap.min.css">
		<link rel="stylesheet" href="yourPathToAngularSwaggerUI/dist/css/swagger-ui.min.css">
  	</head>
</body>

Customization

Enable or disable API explorer

<div swagger-ui url="URLToYourSwagger" api-explorer="true/false"></div>

Define an error handler to catch Swagger loading errors

<div swagger-ui url="URLToYourSwagger" error-handler="yourErrorHandler"></div>
$scope.yourErrorHandler = function(/*HTTP response*/ response, /*HTTP status*/ status){
	
}

Customize API explorer HTTP requests

<div swagger-ui url="URLToYourSwagger" api-explorer-transform="yourTransformFunction"></div>
$scope.yourTransformFunction = function(/*request options*/ options){
	
}

angular-swagger-ui's People

Contributors

crabl avatar mathieuales avatar vrustia-owens avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.