Reserved Characters in Query Parameters
Created by: Louisa-Lee
Description
Reserved Characters in Query Parameters RFC 3986 defines a set of reserved characters :/?#[]@!$&'()*+,;= that are used as URI component delimiters. When these characters need to be used literally in a query parameter value, they are usually percent-encoded. For example, / is encoded as %2F (or %2f), so that the parameter value quotes/h2g2.txt would be sent as GET /file?path=quotes%2Fh2g2.txt If you want a query parameter that is not percent-encoded, add allowReserved: true to the parameter definition: parameters: - in: query name: path required: true schema: type: string allowReserved: true # <----- In this case, the parameter value would be sent like so: GET /file?path=quotes/h2g2.txt
Above is form the specification of OpenAPI 3,
I used the "allowReserved: true" in my delete request, and the query parameter takes the form of "1@2", but when the request is sent,the query parameter still be percent-encoded.
How can I resolve this problem? Any suggestions? Thanks!