fastify / fastify-swagger-ui

Serve Swagger-UI for Fastify
MIT License
142 stars 42 forks source link

plugin config `routePrefix` breaks the page #165

Closed blue86321 closed 2 months ago

blue86321 commented 3 months ago

Prerequisites

Fastify version

4.28.1

Plugin version

4.0.1

Node.js version

20.x

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

14.5

Description

When we config the routePrefix parameter like below

import { fastifySwaggerUi } from "@fastify/swagger-ui";
fastify.register(fastifySwaggerUi, { routePrefix: "/api/docs" })

Link to code that reproduces the bug

No response

Expected Behavior

The documentation page should be rendered correctly even with routePrefix config

blue86321 commented 3 months ago

It works on version 4.0.0, I doubt it's because of this PR #164

mcollina commented 3 months ago

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.