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

fastify-swagger

Package Overview
Dependencies
Maintainers
13
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 4.5.0 to 4.5.1

2

lib/spec/openapi/utils.js

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

function transformDefsToComponents (jsonSchema) {
if (typeof jsonSchema === 'object') {
if (typeof jsonSchema === 'object' && jsonSchema !== null) {
Object.keys(jsonSchema).forEach(function (key) {

@@ -83,0 +83,0 @@ if (key === '$ref') {

{
"name": "fastify-swagger",
"version": "4.5.0",
"version": "4.5.1",
"description": "Serve Swagger/OpenAPI documentation for Fastify, supporting dynamic generation",

@@ -57,3 +57,3 @@ "main": "index.js",

"json-schema-resolver": "^1.2.0",
"openapi-types": "^7.2.3"
"openapi-types": "^8.0.0"
},

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

@@ -226,1 +226,31 @@ 'use strict'

})
test('support default=null', async t => {
const opt = {
schema: {
response: {
'2XX': {
type: 'string',
nullable: true,
default: null
}
}
}
}
const fastify = Fastify()
fastify.register(fastifySwagger, {
openapi: true,
routePrefix: '/docs',
exposeRoute: true
})
fastify.get('/', opt, () => {})
await fastify.ready()
const swaggerObject = fastify.swagger()
const api = await Swagger.validate(swaggerObject)
const definedPath = api.paths['/'].get
t.same(definedPath.responses['2XX'].default, null)
})
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