fastify-swagger
Advanced tools
Comparing version 4.5.0 to 4.5.1
@@ -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) | ||
}) |
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
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
10787926
68254
13395
+ Addedopenapi-types@8.0.0(transitive)
- Removedopenapi-types@7.2.3(transitive)
Updatedopenapi-types@^8.0.0