Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fastify-swagger

Package Overview
Dependencies
Maintainers
7
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastify-swagger - npm Package Compare versions

Comparing version 0.12.0 to 0.13.0

8

dynamic.js

@@ -29,2 +29,4 @@ 'use strict'

const security = opts.swagger.security || null
const tags = opts.swagger.tags || null
const externalDocs = opts.swagger.externalDocs || null

@@ -81,2 +83,8 @@ if (opts.exposeRoute === true) {

}
if (tags) {
swaggerObject.tags = tags
}
if (externalDocs) {
swaggerObject.externalDocs = externalDocs
}

@@ -83,0 +91,0 @@ swaggerObject.paths = {}

14

package.json
{
"name": "fastify-swagger",
"version": "0.12.0",
"version": "0.13.0",
"description": "Generate Swagger files automatically for Fastify.",

@@ -32,14 +32,14 @@ "main": "index.js",

"devDependencies": {
"fastify": "^1.5.0",
"fs-extra": "^6.0.0",
"fastify": "^1.9.0",
"fs-extra": "^7.0.0",
"pre-commit": "^1.2.2",
"standard": "^11.0.0",
"swagger-parser": "^5.0.0",
"swagger-ui-dist": "3.16.0",
"swagger-parser": "^5.0.1",
"swagger-ui-dist": "3.17.3",
"tap": "^12.0.0"
},
"dependencies": {
"fastify-plugin": "^1.0.0",
"fastify-plugin": "^1.2.0",
"fastify-static": "^0.12.0",
"js-yaml": "^3.11.0"
"js-yaml": "^3.12.0"
},

@@ -46,0 +46,0 @@ "standard": {

@@ -23,2 +23,3 @@ # fastify-swagger

fastify.register(require('fastify-swagger'), {
routePrefix: '/documentation',
swagger: {

@@ -30,3 +31,6 @@ info: {

},
routePrefix: '/documentation',
externalDocs: {
url: 'https://swagger.io',
description: 'Find more info here'
},
host: 'localhost',

@@ -36,2 +40,6 @@ schemes: ['http'],

produces: ['application/json'],
tags: [
{ name: 'user', description: 'User related end-points' },
{ name: 'code', description: 'Code related end-points' }
],
securityDefinitions: {

@@ -113,2 +121,3 @@ apiKey: {

},
externalDocs: Object,
host: String,

@@ -118,2 +127,3 @@ schemes: [ String ],

produces: [ String ],
tags: [ Object ],
securityDefinitions: Object

@@ -120,0 +130,0 @@ }

@@ -21,2 +21,9 @@ 'use strict'

produces: ['application/json'],
tags: [
{name: 'tag'}
],
externalDocs: {
description: 'Find more info here',
url: 'https://swagger.io'
},
securityDefinitions: {

@@ -327,2 +334,34 @@ apiKey: {

test('fastify.swagger tags', t => {
t.plan(2)
const fastify = Fastify()
fastify.register(fastifySwagger, swaggerInfo)
fastify.get('/', () => {})
fastify.ready(err => {
t.error(err)
const swaggerObject = fastify.swagger()
t.equal(swaggerObject.tags, swaggerInfo.swagger.tags)
})
})
test('fastify.swagger externalDocs', t => {
t.plan(2)
const fastify = Fastify()
fastify.register(fastifySwagger, swaggerInfo)
fastify.get('/', () => {})
fastify.ready(err => {
t.error(err)
const swaggerObject = fastify.swagger()
t.equal(swaggerObject.externalDocs, swaggerInfo.swagger.externalDocs)
})
})
test('hide support', t => {

@@ -329,0 +368,0 @@ t.plan(2)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc