I am writing a python service with connexion. I have access to the swagger gui of the service via localhost:<port>/ui
. However, when I enter localhost:<port>
in the browser without the /ui
(automatically added by connexion), I get the following message:
{
"detail": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}
Is it possible to customize this message ? In my case, I want localhost:<port>
to return the following message instead:
{"message": "check /ui to have access to the Swagger UI"}
I think I found a solution. Just add the following to the openspec api: