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

Use a document relative url for specs #444

Merged
merged 2 commits into from
Sep 9, 2022
Merged

Conversation

daddykotex
Copy link
Contributor

That means that what was previously

"urls": ["/example.SomeSpec.yaml"]

will now be

"urls": ["./docs/specs/example.SomeSpec.yaml"]

docs is from the path the user provided when initializing the route, specs is added in this PR.

This is to be able to write ./specs/example.SomeSpec.yaml in the urls array for swagger initialization. Rather than asking for /example.SomeSpec.yaml, we ask for ./example.SomeSpec.yaml and because this conflicts with other paths such as ./swagger-ui.css I've decided to serve specs under a specific path instead.

In the browser, this ends up being:

Screen Shot 2022-09-08 at 15 33 08

In the screenshot above, we see requests from the browser after loading /docs/index.html from behind a proxy at /admin/docs/index.html. Before, the request would behttp://localhost/examples.hello.HelloWorldService.json and it would fail to resolve (missing /admin), where as now http://localhost/admin/docs/specs/examples.hello.HelloWorldService.json works.

Relates to #439 but its not sufficient to close it.

That means that what was previously

/example.SomeSpec.yaml

will now be

/docs/specs/example.SomeSpec.yaml
@daddykotex daddykotex merged commit 7aaba05 into main Sep 9, 2022
@Baccata Baccata deleted the dfrancoeur/439-proxied branch September 16, 2022 08:27
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 this pull request may close these issues.

2 participants