Questions tagged [fastify-swagger]

9 questions
3
votes
3 answers

fastify-swagger is not picking up my dynamic routes

I've been a fan of ExpressJs for a long time but in a Youtube video I stumble upon Fastify and wanted to give it a try I'm struggling in making the fastify-swagger plugin work as I assume it should work - dynamic setup to pick up the schema from…
balexandre
  • 73,608
  • 45
  • 233
  • 342
2
votes
0 answers

How to configure Swagger with Fastify to serve different versions of API documentation in different routes

I'm working on a Node.js project using Fastify with TypeScript, and I'm trying to generate API documentation using Swagger for multiple versions of my API ('v1' and 'v2'). I have opted to use the @fastify/swagger along with @fastify/swagger-ui…
Towerss
  • 629
  • 2
  • 12
  • 26
2
votes
1 answer

How to setup @fastify/swagger and @fastify/swagger-ui with TypeScript?

I new to Fastify and I am trying to setup swagger documentation with it. I am using TypeScript and all the examples that I found were using JavaScript and require syntax. I tried to follow the examples where was possible and now my documentation is…
2
votes
1 answer

@fastify/swagger returning 404

I'm trying to get @Fastify/swagger working on a basic Fastify project, but everytime I try to get to the swagger page it just returns as a 404. server.js: const fastify = require('fastify')({logger: true}) const PORT =…
jonnow
  • 814
  • 2
  • 10
  • 19
1
vote
0 answers

swagger is not a function error when using in fastify

I'm trying to use fatify swagger in my fastify app and I was unable to start the application with the fastify swagger. i was getting the error. Please help me in resolving the error. Thanks in advance. This is the error I'm getting when I'm running…
Vamsi
  • 13
  • 4
0
votes
1 answer

Generating the openapi.yml file after passing the tests

After finishing all tests (in tap) I would like to run a script that generates openapi.yml. In the .taprc config, I added the after property: after: utils/generateOpenApi.ts and my script (utils/generateOpenApi.ts) looks like this: const helper =…
Bart Krakowski
  • 1,655
  • 2
  • 8
  • 25
0
votes
0 answers

How to hide/omit required authorization header in OpenAPI

Is there a way to hide authorization header from OpenAPI 3.1.0 UI, so that I would not need to set a dummy unused value every time? Image exmaple For the following schema (copy to playground): openapi: 3.1.0 info: title: Test version:…
0
votes
0 answers

Is there a way to define a object of dynamic keys with same values in swagger?

Object with same value format for all keys in swagger I want to document an API in swagger with nodejs + fastify which has a request body like this. body: { type: "object", properties: { body_param_1: { type: "object", …
0
votes
0 answers

Error [ERR_REQUIRE_ESM]: require() of ES Module in fastify project

Trying to import fastify-openapi-glue in my fastify project but getting error ERR_REQUIRE_ESM and I'm using typescript in the application. Code looks like below routes.ts file /* eslint-disable node/no-unsupported-features/es-syntax */ import {…
Rahul Kumar
  • 3,009
  • 2
  • 16
  • 22