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

basePath Swagger Object configuration does not seem to be supported #89

Open
jcarpe opened this issue Jan 6, 2024 · 3 comments
Open

Comments

@jcarpe
Copy link

jcarpe commented Jan 6, 2024

Bun v1.0.15
Elysia: v0.8.8
Elysia/swagger: v0.8.0

When adding a prefix to my Elysia configuration:

export const elysia = new Elysia({ prefix: BASE_PATH })

I believe I would need to be able to then apply a basePath configuration per the Swagger object config: https://swagger.io/specification/v2/

// pseudo code that does not appear to function as expected
.use(swagger({
  documentation: {
    basePath: BASE_PATH,
    info: {}
  }
}))

The basePath does not appear to be a property of the defined type for the documentation configuration, but this is where it seems to logically appear in the swagger configuration.

@marclave
Copy link
Collaborator

marclave commented Jan 8, 2024

we should also be setting basePath at root for swagger 2.0 the specification, so we can keep the same paths for the endpoints but not have the basePath part of it for the sidebar for example (or swagger ui collapsable sections)

https://swagger.io/docs/specification/2-0/api-host-and-base-path/

@jcarpe
Copy link
Author

jcarpe commented Jan 11, 2024

Just a rather broad update/note here. I've actually been having better success following the 3.0 specification. Still not a resolution to the above though.

@ruslanguns
Copy link

Any work around so I can set the base path accordingly to it? thanks in advance!

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

No branches or pull requests

3 participants