New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

angular-swagger2-client

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-swagger2-client

A simple and powerful OpenAPI/Swagger Client for Angular, based on promises to connect with endpoint using OpenAPI/Swagger Specification 2.0.

latest
Source
npmnpm
Version
0.0.5
Version published
Maintainers
1
Created
Source

Angular OpenAPI/Swagger Client

A simple and powerful OpenAPI/Swagger Client for Angular, based on promises to connect with endpoint using OpenAPI/Swagger Specification 2.0.

Features

  • POST, PUT, GET, DELETE, PATCH and CONNECT request are supported.
  • Params in: query, path, formData and header are supported.
  • SecuritySchema with security in API are supported(only type apiKey).
  • By default, PUT and POST request send with content-type: application/x-www-form-urlencoded.
  • Removes all parameters that have not been established in the API definition.
  • Implements a Pre-Validator for params and supported data types, format and required.
  • Global static and dynamic default value based on LocalStorage.
  • Support for uploading files using consume in the API definition and with at least one parameter in formData.

Getting Started

Install via NPM

npm install angular-swagger2-client

Install via Bower

bower install angular-swagger2-client
  • Include the required libraries in your index.html:
<html>
    <head>
        <title>My Angular Application</title>
        <!-- Angular swagger Client -->
        <script src="vendor/angular-swagger2-client/dist/angular-swagger2-client.js"></script>
    </head>
    <body>
        ...
    </body>
</html>

IMPORTANT: Where vendor you need replace for you downaload directory. If you ussing bower replace for bower_components, and if you using npm you need replace for node_modules

  • Inject angular-swagger2-client module
angular.module('myApp', [
	'angular-swagger2-client'
])
  • Prepare you swagger
angular.module('myApp', [
	'angular-swagger2-client'
]).run(function($rootScope, AngularSwagger2Client) {
	$rootScope.api = new AngularSwagger2Client(YouSwaggerJson);
})

Requirements

  • AngularJS 1.4+

API

object AngularSwagger2Client(Object jsonObject[, Object defaultStaticData[, Array defaultDynamicData]])

Params

object jsonObject required

This param is required and expect a json object of swagger.

IMPORTANT: Only accepts the OpenAPI/Swagger Specification version 2.0.

object defaultStaticData optional

This parameter only accepts an object with keys and their respective values that will be used by default in all API's.

IMPORTANT: Parameters that have not been defined in the parameterObject or securityRequirementObject will not be used.

array defaultDynamicData optional

This parameter only accepts an array with the list of localStorage keys. These keys are processed at runtime to ensure current values are obtained.

IMPORTANT: Parameters that have not been defined in the parameterObject or securityRequirementObject will not be used.

Thanks:

This project is based on the angular-swaggerific repository.

Keywords

angular

FAQs

Package last updated on 23 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts