Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The pre-filled definition URL in swagger UI is incorrect. #11

Closed
2 tasks done
niranjan94 opened this issue Oct 11, 2022 · 1 comment · Fixed by #12
Closed
2 tasks done

The pre-filled definition URL in swagger UI is incorrect. #11

niranjan94 opened this issue Oct 11, 2022 · 1 comment · Fixed by #12
Labels
good first issue Good for newcomers

Comments

@niranjan94
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.8.1

Plugin version

1.0.2

Node.js version

16.15.1

Operating system

macOS

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

12.6

Description

  • The URL of the definition json pre-filled on the swagger UI is incorrect and has an extra static path component in it.
  • Pre-filled: http://127.0.0.1:8080/docs/static/json. Expected: http://127.0.0.1:8080/docs/json

image

Steps to Reproduce

await fastify.register(require('@fastify/swagger'), {
    mode: 'dynamic',
    openapi: {
      info: {
        title: 'api.example.io',
        description: 'Example API',
        version: packageJson.version,
      },
      components: {
        securitySchemes: {
          apiKey: {
            description: 'Your API Key',
            type: 'apiKey',
            name: 'Authorization',
            in: 'header',
          },
        },
      },
    },
    hideUntagged: true,
  })

await fastify.register(require('@fastify/swagger-ui'), {
    routePrefix: '/docs',
    uiConfig: {
      deepLinking: true,
      filter: '',
    },
  })

And goto http://127.0.0.1:8080/docs

Expected Behavior

No response

@climba03003 climba03003 added the good first issue Good for newcomers label Oct 11, 2022
@Uzlopak
Copy link
Collaborator

Uzlopak commented Oct 11, 2022

PR #12 should fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants