You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the bug has not already been reported
Fastify version
5.2.0
Plugin version
5.2.0
Node.js version
v22.11.0
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
win10
Description
When running the project and accessing the Swagger route, for example, http://127.0.0.1:3000/docs, the Swagger page reported this error.
Unable to render this definition
The provided definition does not specify a valid version field.
Please indicate a valid Swagger or OpenAPI version field. Supported version fields are swagger: "2.0" and those that match openapi: 3.x.y (for example, openapi: 3.1.0).
constpath=require('node:path')constAutoLoad=require('@fastify/autoload')constcors=require('@fastify/cors')constresponseHandler=require('./middleware/resHandler.js')constoptions={}module.exports=asyncfunction(fastify,opts){awaitfastify.register(require('@fastify/swagger'),{openapi: {info: {title: 'Test swagger',description: 'Testing the Fastify swagger API',version: '0.1.0'},externalDocs: {url: 'https://swagger.io',description: 'Find more info here'}},})awaitfastify.register(require('@fastify/swagger-ui'),{routePrefix: '/docs',uiConfig: {docExpansion: 'full',deepLinking: false}})awaitresponseHandler(fastify)fastify.register(cors,{origin: '*',methods: ['GET','PUT','POST','DELETE','OPTIONS']})fastify.register(AutoLoad,{dir: path.join(__dirname,'plugins'),options: Object.assign({},opts)})fastify.register(AutoLoad,{dir: path.join(__dirname,'routes'),options: Object.assign({},opts)})fastify.register(require('./plugins/env'))}module.exports.options=options
Link to code that reproduces the bug
No response
Expected Behavior
No response
The text was updated successfully, but these errors were encountered:
Prerequisites
Fastify version
5.2.0
Plugin version
5.2.0
Node.js version
v22.11.0
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
win10
Description
When running the project and accessing the Swagger route, for example, http://127.0.0.1:3000/docs, the Swagger page reported this error.
Unable to render this definition
The provided definition does not specify a valid version field.
Please indicate a valid Swagger or OpenAPI version field. Supported version fields are swagger: "2.0" and those that match openapi: 3.x.y (for example, openapi: 3.1.0).
Link to code that reproduces the bug
No response
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: