Closed henrifardeau closed 2 years ago
EDIT : Sorry my bad, i was using @fastify/swagger instead of fastify-swagger
@henrifardeau did you downgrade to get this working?
It looks like https://www.npmjs.com/package/fastify-swagger is actually deprecated.
They recommend upgrading to @fastify/swagger@6.0.0
Hello,
I'm sorry, as mentioned in #15 for some reason GitHub notifications got lost in my mailbox.
I added support for querystring
in 1.0.0. Does it cover your needs?
@sourcec0de did you ever find a workaround for this? @elierotenberg do we HAVE to use fastify-swagger
to get queryStrings and params working? I am running into this same issue still
EDIT: NVM! my solution was to use @fastify/swagger
in dynamic mode and change swagger
(openAPIV2) in the plugin definition to openapi
:
import { FastifyPluginAsync } from "fastify";
import fp from "fastify-plugin";
import fastifySwagger from "@fastify/swagger";
import fastifySwaggerUi from "@fastify/swagger-ui";
const schemas: FastifyPluginAsync = async (fastify) => {
await fastify.register(fastifySwagger, {
openapi: {
info: {
title: "API",
description: "Documentation for our application APIs",
version: "0.0.1",
},
host: "localhost:8080",
schemes: ["http"],
consumes: ["application/json"],
produces: ["application/json"],
securityDefinitions: {
apiKey: {
type: "apiKey",
name: "Authorization",
in: "header",
},
},
},
});
await fastify.register(fastifySwaggerUi, {
routePrefix: "/documentation",
});
};
export default fp(schemas);
Hello !
I encounter an error when validating parameters or querystring
I register all my schema in my app file like so :
I try to generate documentation based on the "findByIdCustomerSchema" but this is what i'm getting; (It's working for body validation/documentation)
Maybe i'm doing something wrong 😅
Thank you for your help ! (From france 🇫🇷)