@fastify/swagger
Advanced tools
Comparing version 8.8.0 to 8.9.0
@@ -189,2 +189,4 @@ import { FastifyPluginCallback, FastifySchema, RouteOptions, onRequestHookHandler, preHandlerHookHandler } from 'fastify'; | ||
export function formatParamUrl (paramUrl: string): string | ||
export const fastifySwagger: FastifySwagger | ||
@@ -191,0 +193,0 @@ export { fastifySwagger as default } |
'use strict' | ||
const fp = require('fastify-plugin') | ||
const { formatParamUrl } = require('./lib/util/format-param-url') | ||
@@ -32,1 +33,3 @@ function fastifySwagger (fastify, opts, next) { | ||
module.exports.default = fastifySwagger | ||
module.exports.formatParamUrl = formatParamUrl |
'use strict' | ||
const { addHook, resolveSwaggerFunction } = require('../util/common') | ||
const { addHook } = require('../util/add-hook') | ||
const { resolveSwaggerFunction } = require('../util/resolve-swagger-function') | ||
@@ -5,0 +6,0 @@ module.exports = function (fastify, opts, done) { |
'use strict' | ||
const yaml = require('yaml') | ||
const { shouldRouteHide } = require('../../util/common') | ||
const { shouldRouteHide } = require('../../util/should-route-hide') | ||
const { prepareDefaultOptions, prepareOpenapiObject, prepareOpenapiMethod, prepareOpenapiSchemas, normalizeUrl, resolveServerUrls } = require('./utils') | ||
@@ -6,0 +6,0 @@ |
'use strict' | ||
const { readPackageJson, formatParamUrl, resolveLocalRef } = require('../../util/common') | ||
const { readPackageJson } = require('../../util/read-package-json') | ||
const { formatParamUrl } = require('../../util/format-param-url') | ||
const { resolveLocalRef } = require('../../util/resolve-local-ref') | ||
const { xResponseDescription, xConsume, xExamples } = require('../../constants') | ||
@@ -5,0 +7,0 @@ const { rawRequired } = require('../../symbols') |
'use strict' | ||
const yaml = require('yaml') | ||
const { shouldRouteHide } = require('../../util/common') | ||
const { shouldRouteHide } = require('../../util/should-route-hide') | ||
const { prepareDefaultOptions, prepareSwaggerObject, prepareSwaggerMethod, normalizeUrl, prepareSwaggerDefinitions } = require('./utils') | ||
@@ -6,0 +6,0 @@ |
'use strict' | ||
const { readPackageJson, formatParamUrl, resolveLocalRef } = require('../../util/common') | ||
const { readPackageJson } = require('../../util/read-package-json') | ||
const { formatParamUrl } = require('../../util/format-param-url') | ||
const { resolveLocalRef } = require('../../util/resolve-local-ref') | ||
const { xResponseDescription, xConsume } = require('../../constants') | ||
@@ -5,0 +7,0 @@ |
{ | ||
"name": "@fastify/swagger", | ||
"version": "8.8.0", | ||
"version": "8.9.0", | ||
"description": "Serve Swagger/OpenAPI documentation for Fastify, supporting dynamic generation", | ||
@@ -42,3 +42,3 @@ "main": "index.js", | ||
"@apidevtools/swagger-parser": "^10.1.0", | ||
"@fastify/cookie": "^8.3.0", | ||
"@fastify/cookie": "^9.0.4", | ||
"@fastify/pre-commit": "^2.0.2", | ||
@@ -45,0 +45,0 @@ "@types/node": "^20.1.0", |
@@ -9,8 +9,2 @@ # @fastify/swagger | ||
Supports Fastify versions `4.x`. | ||
- Please refer to [6.x](https://github.com/fastify/fastify-swagger/tree/6.x) for Fastify `^3.x` compatibility. | ||
- Please refer to [3.x](https://github.com/fastify/fastify-swagger/tree/2.x) for Fastify `^2.x` compatibility. | ||
- Please refer to [1.x](https://github.com/fastify/fastify-swagger/tree/1.x) for Fastify `^1.x` compatibility. | ||
If you are looking for a plugin to generate routes from an existing OpenAPI schema, check out [fastify-openapi-glue](https://github.com/seriousme/fastify-openapi-glue). | ||
@@ -30,2 +24,18 @@ | ||
### Compatibility | ||
| Plugin version | Fastify version | | ||
| -------------- |---------------- | | ||
| `^7.0.0` | `^4.0.0` | | ||
| `^6.0.0` | `^3.0.0` | | ||
| `^3.0.0` | `^2.0.0` | | ||
| `^1.0.0` | `^1.0.0` | | ||
Please note that if a Fastify version is out of support, then so are the corresponding version(s) of this plugin | ||
in the table above. | ||
See [Fastify's LTS policy](https://github.com/fastify/fastify/blob/main/docs/Reference/LTS.md) for more details. | ||
<a name="usage"></a> | ||
@@ -32,0 +42,0 @@ ## Usage |
@@ -8,3 +8,3 @@ 'use strict' | ||
const fastifySwagger = require('../../../index') | ||
const { readPackageJson } = require('../../../lib/util/common') | ||
const { readPackageJson } = require('../../../lib/util/read-package-json') | ||
const { openapiOption } = require('../../../examples/options') | ||
@@ -11,0 +11,0 @@ |
@@ -8,3 +8,3 @@ 'use strict' | ||
const fastifySwagger = require('../../../index') | ||
const { readPackageJson } = require('../../../lib/util/common') | ||
const { readPackageJson } = require('../../../lib/util/read-package-json') | ||
const { swaggerOption } = require('../../../examples/options') | ||
@@ -11,0 +11,0 @@ |
import fastify from 'fastify'; | ||
import fastifySwagger, { | ||
formatParamUrl, | ||
SwaggerOptions, | ||
@@ -218,1 +219,3 @@ FastifySwaggerInitOAuthOptions, | ||
expectType<OpenAPI.Document | string>(app.swagger({ yaml: Boolean(process.env.YAML) })) | ||
expectType<(arg: string)=>string>(formatParamUrl) |
'use strict' | ||
const { test } = require('tap') | ||
const { formatParamUrl } = require('../lib/util/common') | ||
const { formatParamUrl } = require('../lib/util/format-param-url') | ||
@@ -6,0 +6,0 @@ const cases = [ |
251437
349860
58
7186
946