Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swagger UI has wrong base path

I am using the grape-swagger gem and the standalone installation of SwaggerUI. My API documentation is situated at http://example.com/api/v1/docs/. SwaggerUI discovers all resources, but sends all requests to http://example.com/v1/foo (missing 'api/' from the URL). Why is that?

like image 404
Chrisissorry Avatar asked Sep 03 '26 15:09

Chrisissorry


1 Answers

For documentation if somebody experiences the same problem: There is a paramater for the grape-swagger method add_swagger_documentation called base_path. In my case, I had to specify

base_path: '/api'
like image 81
Chrisissorry Avatar answered Sep 06 '26 06:09

Chrisissorry



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!