[GH-ISSUE #147] MP_WEBROOT is ignored in the API-Documentation #99

Closed
opened 2026-03-15 12:32:31 +03:00 by kerem · 4 comments
Owner

Originally created by @christian-scheible on GitHub (Jul 25, 2023).
Original GitHub issue: https://github.com/axllent/mailpit/issues/147

I have set MP_WEBROOT to mailcatcher. However when I am visiting http://localhost/mailcatcher/api/v1/ the documentation shows:

API Server http://localhost

and if I try to test a request using the TRY button, the request fails as it doesn't append mailcatcher to the request.

So it tries http://localhost/api/v1/info instead of http://localhost/mailcatcher/api/v1/info

Originally created by @christian-scheible on GitHub (Jul 25, 2023). Original GitHub issue: https://github.com/axllent/mailpit/issues/147 I have set **MP_WEBROOT** to _mailcatcher_. However when I am visiting http://localhost/mailcatcher/api/v1/ the documentation shows: **API Server http://localhost** and if I try to test a request using the **TRY** button, the request fails as it doesn't append mailcatcher to the request. So it tries `http://localhost/api/v1/info` instead of `http://localhost/mailcatcher/api/v1/info`
kerem 2026-03-15 12:32:31 +03:00
Author
Owner

@axllent commented on GitHub (Jul 25, 2023):

You are absolutely right - currently the swagger config does not take the current webroot into consideration. I'll need to think of a solution for this as the swagger.json spec file for the API (used in the docs you are referring to) is embedded in the application, and not dynamically generated based on startup arguments.

<!-- gh-comment-id:1649479944 --> @axllent commented on GitHub (Jul 25, 2023): You are absolutely right - currently the swagger config does not take the current webroot into consideration. I'll need to think of a solution for this as the `swagger.json` spec file for the API (used in the docs you are referring to) is embedded in the application, and not dynamically generated based on startup arguments.
Author
Owner

@christian-scheible commented on GitHub (Jul 25, 2023):

@axllent, that was quick, thank you! It's not a blocker for me, as I am now using Postman to explore the API. However, I believe honoring the environment variable would make it easier for other users.

<!-- gh-comment-id:1649503541 --> @christian-scheible commented on GitHub (Jul 25, 2023): @axllent, that was quick, thank you! It's not a blocker for me, as I am now using Postman to explore the API. However, I believe honoring the environment variable would make it easier for other users.
Author
Owner

@axllent commented on GitHub (Jul 30, 2023):

@christian-scheible This should be fixed now in the latest release 🚀 Please feel free to re-open this ticket if it's not working as you expected.

<!-- gh-comment-id:1657066849 --> @axllent commented on GitHub (Jul 30, 2023): @christian-scheible This should be fixed now in the latest release :rocket: Please feel free to re-open this ticket if it's not working as you expected.
Author
Owner

@christian-scheible commented on GitHub (Jul 31, 2023):

@axllent Thank you for the quick solution. It is now working as expected.

<!-- gh-comment-id:1657868645 --> @christian-scheible commented on GitHub (Jul 31, 2023): @axllent Thank you for the quick solution. It is now working as expected.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#99
No description provided.