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

Make doc.json filename configurable. #54

Open
jeffreydwalter opened this issue Oct 2, 2021 · 3 comments
Open

Make doc.json filename configurable. #54

jeffreydwalter opened this issue Oct 2, 2021 · 3 comments

Comments

@jeffreydwalter
Copy link

If I do:

r.Get("/swagger/*", swagger.Handler(swagger.URL("http://localhost/swagger/doc.json")))

returns the swagger json at http://localhost/swagger/doc.json.

I would like to make the json available at http://localhost/swagger/swagger.json.
If I do:

r.Get("/swagger/*", swagger.Handler(swagger.URL("http://localhost/swagger/swagger.json")))

I get a 404.

Is there a way to do that currently? If not, would you accept a PR to enable it?

@ubogdan
Copy link
Contributor

ubogdan commented Oct 2, 2021

Hi @jeffreydwalter,
We don't have this kind of customization available. If this is really important to you please feel free and contribute with a PR.

Thanks.

@nickkieffer
Copy link

nickkieffer commented Feb 9, 2022

Using swag init produces swagger.json, why would that not be the default? Am I missing something here?

@ubogdan
Copy link
Contributor

ubogdan commented Apr 16, 2022

The HTTP handler uses the documentation that is embedded in the docs.go file.

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