Closed linnhk closed 4 years ago
I guess this PR means I should write some more tests for the actual output from SpecRenderer...
It won't work using the stash variable, since that will alter the URLs that are rendered later on, like here: https://github.com/jhthorsen/mojolicious-plugin-openapi/blob/ee4d5c9346cd53194451a5509231ffe2e03c36fe/lib/Mojolicious/Plugin/OpenAPI/SpecRenderer.pm#L486
Example: schemes is [https, http], then all the links will be rendered with "http" instead of the preferred "https" scheme.
I see that the issue can be solved by changing the
$url
from:my $url = Mojo::URL->new("http://$spec->{host}");
tomy $url = Mojo::URL->new("http://$spec->{host}")->path($spec->{basePath});
as well, but I would prefer using$base_url
since it's already stashed.