fastify-swagger
Advanced tools
Comparing version 2.4.0 to 2.5.0
@@ -29,2 +29,10 @@ import fastify = require('fastify'); | ||
app.get('/public/route', { | ||
schema: { | ||
description: 'returns 200 OK', | ||
summary: 'qwerty', | ||
security: [] | ||
} | ||
}, (req, reply) => {}); | ||
app | ||
@@ -31,0 +39,0 @@ .register(fastifySwagger, { |
@@ -64,3 +64,4 @@ import * as http from 'http'; | ||
summary?: string; | ||
security?: [{ [securityLabel: string]: string[] }]; | ||
consumes?: string[]; | ||
security?: Array<{ [securityLabel: string]: string[] }>; | ||
} | ||
@@ -67,0 +68,0 @@ } |
{ | ||
"name": "fastify-swagger", | ||
"version": "2.4.0", | ||
"version": "2.5.0", | ||
"description": "Generate Swagger files automatically for Fastify.", | ||
@@ -33,18 +33,18 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@types/node": "^11.9.0", | ||
"fastify": "^2.0.0", | ||
"fs-extra": "^7.0.1", | ||
"@types/node": "^12.11.7", | ||
"fastify": "^2.10.0", | ||
"fs-extra": "^8.0.1", | ||
"joi": "^14.3.1", | ||
"joi-to-json-schema": "^4.0.0", | ||
"joi-to-json-schema": "^5.1.0", | ||
"pre-commit": "^1.2.2", | ||
"standard": "^12.0.1", | ||
"standard": "^14.0.2", | ||
"swagger-parser": "^6.0.3", | ||
"swagger-ui-dist": "3.22.1", | ||
"tap": "^12.5.3", | ||
"typescript": "^3.2.4" | ||
"swagger-ui-dist": "3.24.3", | ||
"tap": "^12.7.0", | ||
"typescript": "^3.7.2" | ||
}, | ||
"dependencies": { | ||
"@types/swagger-schema-official": "^2.0.15", | ||
"fastify-plugin": "^1.5.0", | ||
"fastify-static": "^2.3.4", | ||
"@types/swagger-schema-official": "^2.0.20", | ||
"fastify-plugin": "^1.6.0", | ||
"fastify-static": "^2.5.1", | ||
"js-yaml": "^3.12.1" | ||
@@ -54,5 +54,11 @@ }, | ||
"ignore": [ | ||
"static" | ||
"static", | ||
"tap" | ||
] | ||
}, | ||
"greenkeeper": { | ||
"ignore": [ | ||
"tap" | ||
] | ||
} | ||
} |
@@ -8,27 +8,27 @@ /* IMPORTANT | ||
'use strict' | ||
exports[`test/static.js TAP specification validation check works > undefined 1`] = ` | ||
exports['test/static.js TAP specification validation check works > undefined 1'] = ` | ||
Error: specification is missing in the module options | ||
` | ||
exports[`test/static.js TAP specification validation check works > undefined 2`] = ` | ||
exports['test/static.js TAP specification validation check works > undefined 2'] = ` | ||
Error: specification is not an object | ||
` | ||
exports[`test/static.js TAP specification validation check works > undefined 3`] = ` | ||
exports['test/static.js TAP specification validation check works > undefined 3'] = ` | ||
Error: both specification.path and specification.document are missing, should be path to the file or swagger document spec | ||
` | ||
exports[`test/static.js TAP specification validation check works > undefined 4`] = ` | ||
exports['test/static.js TAP specification validation check works > undefined 4'] = ` | ||
Error: specification.path is not a string | ||
` | ||
exports[`test/static.js TAP specification validation check works > undefined 5`] = ` | ||
exports['test/static.js TAP specification validation check works > undefined 5'] = ` | ||
Error: /hello/lionel.richie does not exist | ||
` | ||
exports[`test/static.js TAP specification validation check works > undefined 6`] = ` | ||
exports['test/static.js TAP specification validation check works > undefined 6'] = ` | ||
Error: specification.postProcessor should be a function | ||
` | ||
exports[`test/static.js TAP swagger route returns json > undefined 1`] = ` | ||
exports['test/static.js TAP swagger route returns json > undefined 1'] = ` | ||
{ | ||
@@ -87,3 +87,3 @@ "openapi": "3.0.0", | ||
exports[`test/static.js TAP postProcessor works, swagger route returns updated yaml > undefined 1`] = ` | ||
exports['test/static.js TAP postProcessor works, swagger route returns updated yaml > undefined 1'] = ` | ||
openapi: 3.0.0 | ||
@@ -123,3 +123,3 @@ info: | ||
exports[`test/static.js TAP swagger route returns explicitly passed doc > undefined 1`] = ` | ||
exports['test/static.js TAP swagger route returns explicitly passed doc > undefined 1'] = ` | ||
{ | ||
@@ -126,0 +126,0 @@ "info": { |
@@ -88,3 +88,3 @@ 'use strict' | ||
{ | ||
'apiKey': [] | ||
apiKey: [] | ||
} | ||
@@ -187,3 +187,3 @@ ] | ||
t.strictEqual(res.statusCode, 302) | ||
t.strictEqual(res.headers['location'], '/documentation/static/index.html') | ||
t.strictEqual(res.headers.location, '/documentation/static/index.html') | ||
t.is(typeof res.payload, 'string') | ||
@@ -213,3 +213,3 @@ }) | ||
t.strictEqual(res.statusCode, 302) | ||
t.strictEqual(res.headers['location'], '/v1/documentation/static/index.html') | ||
t.strictEqual(res.headers.location, '/v1/documentation/static/index.html') | ||
t.is(typeof res.payload, 'string') | ||
@@ -244,3 +244,3 @@ }) | ||
t.strictEqual(res.statusCode, 302) | ||
t.strictEqual(res.headers['location'], '/v1/foobar/static/index.html') | ||
t.strictEqual(res.headers.location, '/v1/foobar/static/index.html') | ||
t.is(typeof res.payload, 'string') | ||
@@ -266,3 +266,3 @@ }) | ||
t.strictEqual(res.statusCode, 302) | ||
t.strictEqual(res.headers['location'], '/static/index.html') | ||
t.strictEqual(res.headers.location, '/static/index.html') | ||
t.is(typeof res.payload, 'string') | ||
@@ -291,3 +291,3 @@ }) | ||
t.is(res.statusCode, 302) | ||
t.is(res.headers['location'], '/documentation/static/index.html') | ||
t.is(res.headers.location, '/documentation/static/index.html') | ||
}) | ||
@@ -399,7 +399,6 @@ | ||
t.strictEqual(res.statusCode, 404) | ||
t.deepEqual({ | ||
message: 'Not Found', | ||
t.match(payload, { | ||
error: 'Not Found', | ||
statusCode: 404 | ||
}, payload) | ||
}) | ||
}) | ||
@@ -406,0 +405,0 @@ }) |
@@ -136,3 +136,3 @@ 'use strict' | ||
{ | ||
'apiKey': [] | ||
apiKey: [] | ||
} | ||
@@ -307,12 +307,12 @@ ] | ||
definitions: { | ||
'ExampleModel': { | ||
'type': 'object', | ||
'properties': { | ||
'id': { | ||
'type': 'integer', | ||
'description': 'Some id' | ||
ExampleModel: { | ||
type: 'object', | ||
properties: { | ||
id: { | ||
type: 'integer', | ||
description: 'Some id' | ||
}, | ||
'name': { | ||
'type': 'string', | ||
'description': 'Name of smthng' | ||
name: { | ||
type: 'string', | ||
description: 'Name of smthng' | ||
} | ||
@@ -319,0 +319,0 @@ } |
@@ -23,2 +23,3 @@ import fastify = require('fastify'); | ||
summary: 'qwerty', | ||
consumes: ['application/json', 'multipart/form-data'], | ||
security: [{ apiKey: []}] | ||
@@ -28,2 +29,10 @@ } | ||
app.get('/public/route', { | ||
schema: { | ||
description: 'returns 200 OK', | ||
summary: 'qwerty', | ||
security: [] | ||
} | ||
}, (req, reply) => {}); | ||
app | ||
@@ -30,0 +39,0 @@ .register(fastifySwagger, { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
9205007
9174
3
10
27
Updatedfastify-plugin@^1.6.0
Updatedfastify-static@^2.5.1