@socialtables/apidoc-swagger

1.1.0 • Public • Published

apidoc-swagger

Build Status: CircleCI

apidoc and swagger are two nice projects which are focusing on documentation of APIs. This project is a middle tier which tries to bring them together in a sense that:

It uses apidoc to convert inline documentation comments into json schema and later convert it to swagger json schema.

Uses the apidoc-core library.

How It Works

By putting in line comments in the source code like this in javascript, you will get swagger.json file which can be served to swagger-ui to generate html overview of documentation.

/api/foo.js:

/**
 * @api {get} /user/id Request User information
 * @apiName GetUser
 * @apiGroup User
 *
 * @apiParam {Number} id Users unique ID.
 *
 * @apiSuccess {String} firstname Firstname of the User.
 * @apiSuccess {String} lastname  Lastname of the User.
 */

Installation

npm install apidoc-swagger -g

Current version unlocks most of the basic capabilities of both projects and improvement is in progress.

Example

apidoc-swagger -i example/ -o doc/

Have a look at apidoc for full functionality overview and capabilities of apidoc.

To read more about how swagger works refer to swagger-ui and swagger-spec for details of swagger.json.

Gulp Module

gulp-apidoc-swagger npm install gulp-apidoc-swagger.

/@socialtables/apidoc-swagger/

    Package Sidebar

    Install

    npm i @socialtables/apidoc-swagger

    Weekly Downloads

    194

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    25 kB

    Total Files

    12

    Last publish

    Collaborators

    • asrivastava2
    • kscherling
    • cdoucet
    • alishaq
    • julia.chen
    • johnmarkus.cs
    • jasper-tan_cvent
    • karana026
    • atangri
    • tom.mcnutt
    • ramandeepst
    • nehasharmast
    • jmorley-cvent
    • rmcvent
    • andrewmking
    • abenjamin
    • sramkumar2
    • ivaswanicasas
    • bporter42
    • ktst
    • bmontague-cvent
    • jcoutee
    • liz.thorne
    • robbe1912
    • st-awaas
    • jblackowiak
    • smiles.socialtables
    • alok2k5singh
    • sarahu-cv
    • jrnail23
    • socialtables-engineering
    • yi.chen
    • katherine.thompson
    • mattmcclure
    • socialtables-deployer
    • gvorvik
    • briankim4311
    • andrewcsontos
    • adamlind
    • nnarra
    • ashanevs
    • sarawegmann
    • ishak
    • johnbryant262
    • pinko-fowle
    • ldelarosa
    • pho3nixf1re
    • _evilnix_
    • sarthak.chatterjee
    • joshlartz
    • kgardi
    • otaghlabi
    • dwicks-socialtables
    • jonathandaigle
    • j.martin