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.10.1 to 0.10.2

2

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

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -10,3 +10,3 @@ 'use strict'

schema: { hide: true },
handler: (request, reply) => reply.redirect(`${fastify.basePath}/index.html`)
handler: (request, reply) => reply.redirect(path.join(fastify.basePath, 'index.html'))
})

@@ -13,0 +13,0 @@

@@ -246,2 +246,23 @@ 'use strict'

test('with routePrefix: \'/\' should redirect to /index.html', t => {
t.plan(4)
const fastify = Fastify()
const opts = JSON.parse(JSON.stringify(swaggerInfo))
opts.routePrefix = '/'
fastify.register(fastifySwagger, opts)
fastify.get('/foo', () => {})
fastify.inject({
method: 'GET',
url: '/'
}, (err, res) => {
t.error(err)
t.strictEqual(res.statusCode, 302)
t.strictEqual(res.headers['location'], '/index.html')
t.is(typeof res.payload, 'string')
})
})
test('/documentation/:file should send back the correct file', t => {

@@ -248,0 +269,0 @@ t.plan(21)

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