So this is not going to be supported soon (it's not even planned for Swagger 3.0), and I have to resort to a workaround.
If I have a path /tags{tag_path}
and I enter something like this as tag_path
: /foo/bar
, then the actual query request URL will be: /tags%2Ffoo%2Fbar
. So, I just added support for that on my backend: the endpoint handler for /tags*
urldecodes the path (which is %2Ffoo%2Fbar
), and it becomes /foo/bar
again.
Yes, a hack, but it works, and it's better than nothing. In my case, tag names can't contain the /
character, so there's no conflict. Your mileage may vary, of course.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…