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

No BasePath in Swagger causes Swagger-UI Incompatibility #147

Closed
lesthawk opened this issue Jan 8, 2018 · 1 comment
Closed

No BasePath in Swagger causes Swagger-UI Incompatibility #147

lesthawk opened this issue Jan 8, 2018 · 1 comment
Labels

Comments

@lesthawk
Copy link

lesthawk commented Jan 8, 2018

Expected Behavior

Path to subdirectory url should be included in the Swagger.

Actual Behavior

It isn't.

Steps to Reproduce the Problem

  1. load the swagger page, no basePath value

The Issue's effect

As there's no basepath, Swagger-ui is unable to redirect the method to the correct path when it is not at the root url.
e.g. If the service is deployed to http://bob.com/Jane/
then a method DoSomething should be accessible in Swagger UI as http://bob.com/Jane/DoSomething
However because the basepath is not being included by Nancy Swagger, the Swagger Ui generates this as:
http://bob.com/DoSomething

The alternative is to generate the swagger ui based on the entire deployed path not assuming the url is always deployed at root.

@jnallard jnallard added the bug label Jan 10, 2018
@jnallard
Copy link
Collaborator

jnallard commented Jan 10, 2018

Yeah, this is probably something that was overlooked.
I'll look into this tomorrow, if I get the chance.

Feel free to submit a PR yourself, as it should be pretty easy if you just add it to the SwaggerMetadataProvider.SetInfo function (and to the Info object).

Edit:
I was mistaken - the basePath is not part of the info object.

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

No branches or pull requests

2 participants