Skip to content

Query parameters with allowReserved=false not percent-encoded during OAS3 "Try It Out" #3817

@hkosova

Description

@hkosova
Q A
Bug or feature request? Bug
Which Swagger/OpenAPI version? 3.0
Which Swagger-UI version? 3.4.0
How did you install Swagger-UI? http://editor.swagger.io
Which browser & version? Chrome 61
Which operating system? Windows 7

Demonstration API definition

openapi: 3.0.0
info:
  title: math.js web service
  version: '1.0'
servers:
  - url: http://api.mathjs.org/v1
paths:
  /:
    get:
      summary: Evaluates an expression and returns result as plain text
      parameters:
        - in: query
          name: expr
          required: true
          description: The expression to be evaluated
          schema:
            type: string
            example: 2+3*sqrt(4)
      responses:
        '200':
          description: OK
          content:
            text/html:
              schema:
                type: string

To reproduce the issue, call the API using the parameter value 2+3.

Expected Behavior

Request URL is http://api.mathjs.org/v1/?expr=2%2B3 (with 2%2B3 instead of 2+3)

Current Behavior

Request URL is http://api.mathjs.org/v1/?expr=2+3

Context

The issue affects OpenAPI 3.0 specs only.

CC #3641

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions