Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
restify-swagger-jsdoc
Advanced tools
Readme
Create Swagger documentation page based on jsdoc
If you use a restify version prior to v7, you must use the following command:
npm install restify-swagger-jsdoc@^1 --production
Else you can use the following command:
npm install restify-swagger-jsdoc --production
To initialize the swagger JSDoc page, simply add this lines to the file that loads your restify server :
var restifySwaggerJsdoc = require('restify-swagger-jsdoc');
restifySwaggerJsdoc.createSwaggerPage({
title: 'API documentation', // Page title (required)
version: '1.0.0', // Server version (required)
server: server, // Restify server instance created with restify.createServer() (required)
path: '/docs/swagger', // Public url where the swagger page will be available (required)
description: 'My great app', // A short description of the application. (default: '')
tags: [{ // A list of tags used by the specification with additional metadata (default: [])
name: 'Tag name',
description: 'Tag description'
}],
host: 'google.com', // The host (name or ip) serving the API. This MUST be the host only and does not include the scheme nor sub-paths.
schemes: [], // The transfer protocol of the API. Values MUST be from the list: 'http', 'https', 'ws', 'wss'. (default: [])
apis: [ `${__dirname}/controllers/*.js` ], // Path to the API docs (default: [])
definitions: {myObject: require('api/myObject.json')}, // External definitions to add to swagger (default: [])
routePrefix: 'prefix', // Prefix to add for all routes (default: '')
forceSecure: false, // Force swagger-ui to use https protocol to load JSON file (default: false)
validatorUrl: 'http://example.com', // Validate specs against given validator, set to null to disable validation (default: 'https://online.swagger.io/validator')
supportedSubmitMethods: ['get', 'post'] // List of HTTP methods that have the Try it out feature enabled. An empty array disables Try it out for all operations. (default: ['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace'])
});
With these settings, assuming that your server listens on port 80, the Swagger documentation page will be available at http://localhost/docs/swagger.
The swagger.json file is available at http://localhost/docs/swagger/swagger.json.
This module is based on swagger-jsdoc, so you can refer to this module's documentation to document your API.
FAQs
Create Swagger documentation page based on jsdoc
The npm package restify-swagger-jsdoc receives a total of 694 weekly downloads. As such, restify-swagger-jsdoc popularity was classified as not popular.
We found that restify-swagger-jsdoc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.