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

Swagger does not generate documentation if path is set to the home directory. #115

Closed
akainocode opened this issue Apr 17, 2024 · 2 comments · Fixed by #118
Closed

Swagger does not generate documentation if path is set to the home directory. #115

akainocode opened this issue Apr 17, 2024 · 2 comments · Fixed by #118

Comments

@akainocode
Copy link

akainocode commented Apr 17, 2024

Swagger doesn't appear to generate documentation if the path is set to '/', an example here:

import { Elysia } from 'elysia';
import { swagger } from '@elysiajs/swagger'

const app = new Elysia()
  .use(swagger({
    path: '/',
    documentation : {
      tags : [
        { name: 'tag1', description: 'desc1'},
      ]
    }
  }))
  .get('/test', () => "Test", {
    detail : {
      tags: ['tag1']
    } 
  })
  .listen(3000)

The above only generates the background page for the swagger documentation, while if you adjust the path parameter to anything else or even remove it, it appears to work.

I can write a workaround to achieve the intended effect, but it does appear to be a bug.

@marclave
Copy link
Collaborator

got a PR open :)

#118

@akainocode
Copy link
Author

Thank you! I'll close this issue once it gets merged.

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

Successfully merging a pull request may close this issue.

2 participants