I have an API with parameters.
In my OpenAPI documentation I used the allowReserved: true property to escape special characters, but unfortunately one parameter contains the % sign which is not in the list.
Is there any possibility to escape the % sign?
- name: sig
in: query
required: true
schema:
type: string
allowReserved: true
This is from the Swagger documentation:
Additionally, the
allowReservedkeyword specifies whether the reserved characters:/?#[]@!$&'()*+,;=in parameter values are allowed to be sent as they are, or should be percent-encoded. By default, allowReserved is false, and reserved characters are percent-encoded. For example,/is encoded as%2F(or%2f), so that the parameter valuequotes/h2g2.txtwill be sent asquotes%2Fh2g2.txt
Because the percent character % has a special meaning in query strings (it's an indicator of percent-encoded octets), clients are supposed to always encode % as %25 when this character is used literally in the query string. Servers, in their turn, decode %25 back to % when processing requests.
This is the default behavior and does not require any special attributes in the OpenAPI document.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With