Forum Discussion

ayw's avatar
ayw
Visitor
6 years ago

Double encoding/decoding of path params

I have a service written using OpenAPI 3.0 with connexion. I have path parameters that contain slashes, so I want to submit them utf-8 encoded. When I enter a path parameter such as "%2F%2Fpds%3ATarget_Identification%2Fpds%3Aname" (this is "//pds:Target_Identification/pds:name" utf-8 encoded), Swagger UI generates the following parameter it its curl command: "%252F%252Fpds%253ATarget_Identification%252Fpds%253Aname", where the %s in the submitted param have been encoded again as "%25". The problem is if I want to send requests to my service using curl, I have to do the double encoding of the %s like the Swagger UI is doing. If I do the single encoding as desired, I get the response: 

{
"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"
}

I think it is decoding the %2Fs back to slashes before evaluating the URL, then saying it can't find this non-existent URL. How can I fix this so I can use single-encoded path parameters?

 

This issue says this has been fixed but I'm still seeing the same behavior.

No RepliesBe the first to reply