Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-136926

[OAS] Add a 'allowReserved' handling for query parameters into generation templates

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • Network
    • None

    Description

      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

       

      Actual result:

      There is no checks for 'allowReserved' value in the generator's code.

      Expected result:

      Add  the check in *.mustache files , that reads 'allowReserved' value and applies/or not applies toPercentEncoding().

      More info:

      See https://swagger.io/docs/specification/v3_0/describing-parameters/

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            cnn Qt Core & Network
            tatiana.borisova Tatiana Borisova
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes