Socket
Socket
Sign inDemoInstall

@fastify/swagger

Package Overview
Dependencies
Maintainers
20
Versions
38
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 9.0.0-pre.fv5.1 to 9.0.0

7

examples/options.js

@@ -193,4 +193,7 @@ 'use strict'

querystring: {
hello: { type: 'string' },
world: { type: 'string' }
type: 'object',
properties: {
hello: { type: 'string' },
world: { type: 'string' }
}
}

@@ -197,0 +200,0 @@ }

@@ -61,2 +61,8 @@ import { FastifyPluginCallback, FastifySchema, RouteOptions, onRequestHookHandler, preHandlerHookHandler } from 'fastify';

type SwaggerDocumentObject = {
swaggerObject: Partial<OpenAPIV2.Document>;
} | {
openapiObject: Partial<OpenAPIV3.Document | OpenAPIV3_1.Document>;
}
type SwaggerTransform = <S extends FastifySchema = FastifySchema>({

@@ -66,4 +72,3 @@ schema,

route,
swaggerObject,
openapiObject,
...documentObject
}: {

@@ -73,6 +78,6 @@ schema: S;

route: RouteOptions;
swaggerObject: Partial<OpenAPIV2.Document>;
openapiObject: Partial<OpenAPIV3.Document | OpenAPIV3_1.Document>;
}) => { schema: FastifySchema; url: string }
} & SwaggerDocumentObject) => { schema: FastifySchema; url: string }
type SwaggerTransformObject = (documentObject: SwaggerDocumentObject) => Partial<OpenAPIV2.Document> | Partial<OpenAPIV3.Document | OpenAPIV3_1.Document>;
type FastifySwagger = FastifyPluginCallback<fastifySwagger.SwaggerOptions>

@@ -153,6 +158,3 @@

*/
transformObject?: ({ swaggerObject, openapiObject }: {
swaggerObject: Partial<OpenAPIV2.Document>;
openapiObject: Partial<OpenAPIV3.Document | OpenAPIV3_1.Document>;
}) => Partial<OpenAPIV2.Document> | Partial<OpenAPIV3.Document | OpenAPIV3_1.Document>;
transformObject?: SwaggerTransformObject;

@@ -159,0 +161,0 @@ refResolver?: {

{
"name": "@fastify/swagger",
"version": "9.0.0-pre.fv5.1",
"version": "9.0.0",
"description": "Serve Swagger/OpenAPI documentation for Fastify, supporting dynamic generation",

@@ -43,6 +43,6 @@ "main": "index.js",

"@apidevtools/swagger-parser": "^10.1.0",
"@fastify/cookie": "^10.0.0-pre.fv5.1",
"@fastify/cookie": "^10.0.0",
"@fastify/pre-commit": "^2.1.0",
"@types/node": "^20.12.8",
"fastify": "^5.0.0-alpha.3",
"@types/node": "^22.0.0",
"fastify": "^5.0.0-alpha.4",
"fluent-json-schema": "^5.0.0",

@@ -57,3 +57,3 @@ "joi": "^17.13.1",

"dependencies": {
"fastify-plugin": "^5.0.0-pre.fv5.1",
"fastify-plugin": "^5.0.0",
"json-schema-resolver": "^2.0.0",

@@ -60,0 +60,0 @@ "openapi-types": "^12.1.3",

@@ -1449,9 +1449,18 @@ 'use strict'

headers: {
'X-Port': portSchema
type: 'object',
properties: {
'X-Port': portSchema
}
},
querystring: {
port: portSchema
type: 'object',
properties: {
port: portSchema
}
},
params: {
port: portSchema
type: 'object',
properties: {
port: portSchema
}
}

@@ -1571,9 +1580,18 @@ }

headers: {
'X-Port': portSchema
type: 'object',
properties: {
'X-Port': portSchema
}
},
querystring: {
port: portSchema
type: 'object',
properties: {
port: portSchema
}
},
params: {
port: portSchema
type: 'object',
properties: {
port: portSchema
}
}

@@ -1580,0 +1598,0 @@ }

@@ -126,5 +126,8 @@ 'use strict'

schema: {
name: { type: 'string' },
image: { type: 'string' },
address: { type: 'string' }
type: 'object',
properties: {
name: { type: 'string' },
image: { type: 'string' },
address: { type: 'string' }
}
}

@@ -134,4 +137,7 @@ },

schema: {
fullName: { type: 'string' },
phone: { type: 'string' }
type: 'object',
properties: {
fullName: { type: 'string' },
phone: { type: 'string' }
}
}

@@ -148,3 +154,6 @@ }

300: {
age: { type: 'number' }
type: 'object',
properties: {
age: { type: 'number' }
}
}

@@ -151,0 +160,0 @@ }

@@ -223,4 +223,3 @@ import fastify, { FastifySchema, RouteOptions } from 'fastify';

route,
swaggerObject,
openapiObject,
...documentObject
}) => {

@@ -230,6 +229,3 @@ schema satisfies FastifySchema;

route satisfies RouteOptions;
swaggerObject satisfies Partial<OpenAPIV2.Document>;
openapiObject satisfies Partial<
OpenAPIV3.Document | OpenAPIV3_1.Document
>;
documentObject satisfies { swaggerObject: Partial<OpenAPIV2.Document> } | { openapiObject: Partial<OpenAPIV3.Document | OpenAPIV3_1.Document> };
return { schema, url };

@@ -236,0 +232,0 @@ },

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