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

fastify-swagger

Package Overview
Dependencies
Maintainers
6
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.3.2 to 0.4.0

4

index.js

@@ -104,2 +104,6 @@ 'use strict'

if (schema.consumes) {
swaggerMethod.consumes = schema.consumes
}
if (schema.querystring) {

@@ -106,0 +110,0 @@ getQueryParams(parameters, schema.querystring)

8

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

@@ -26,7 +26,7 @@ "main": "index.js",

"standard": "^10.0.3",
"swagger-parser": "^4.0.1",
"tap": "^11.0.0"
"swagger-parser": "^4.0.2",
"tap": "^11.1.0"
},
"dependencies": {
"fastify-plugin": "^0.2.1",
"fastify-plugin": "^0.2.2",
"js-yaml": "^3.10.0"

@@ -33,0 +33,0 @@ },

@@ -346,1 +346,37 @@ 'use strict'

})
test('route meta info', t => {
t.plan(6)
const fastify = Fastify()
fastify.register(fastifySwagger, swaggerInfo)
const opts = {
schema: {
summary: 'Route summary',
tags: ['tag'],
description: 'Route description',
consumes: ['application/x-www-form-urlencoded']
}
}
fastify.get('/', opts, () => {})
fastify.ready(err => {
t.error(err)
const swaggerObject = fastify.swagger()
Swagger.validate(swaggerObject)
.then(function (api) {
const definedPath = api.paths['/'].get
t.ok(definedPath)
t.equal(opts.schema.summary, definedPath.summary)
t.same(opts.schema.tags, definedPath.tags)
t.equal(opts.schema.description, definedPath.description)
t.same(opts.schema.consumes, definedPath.consumes)
})
.catch(function (err) {
t.fail(err)
})
})
})
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