-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Description
Q&A
- Swagger-UI version: 5.19.0 (current versions, like on editor.swagger.io and editor-next.swagger.io)
- Swagger/OpenAPI version: OpenAPI 3.1.0
Content & configuration
Example Swagger/OpenAPI definition:
openapi: 3.1.0
info:
title: primes.org
description: A prime number API
contact:
name: Florian Hurlbrink
url: https://florian.hurlbrink.name
email: [email protected]
version: 1.0.0
servers:
- url: https://primes.org
description: Generated server url
paths:
/π/{x}:
get:
tags:
- root-rest-controller
summary: Prime-counting function
description: Returns quantity of prime numbers less than or equal a specified number
operationId: pi
parameters:
- name: x
in: path
description: Number to be used as upper border. The quantity of prime numbers less or equal to this border will be returned
required: true
schema:
type: number
format: double
example: 10.3
responses:
'200':
description: Quantity of prime numbers less than or equal the specified number
content:
application/json:
schema:
type: integer
format: int64
example: 4
'404':
description: Specified number exceeds boundaries
/pi/{x}:
get:
tags:
- root-rest-controller
summary: Prime-counting function
description: Returns quantity of prime numbers less than or equal a specified number
operationId: pi_1
parameters:
- name: x
in: path
description: Number to be used as upper border. The quantity of prime numbers less or equal to this border will be returned
required: true
schema:
type: number
format: double
example: 10.3
responses:
'200':
description: Quantity of prime numbers less than or equal the specified number
content:
application/json:
schema:
type: integer
format: int64
example: 4
'404':
description: Specified number exceeds boundaries
Describe the bug you're encountering
When a path contains special chars, path parameters will not be replaced
To reproduce...
Steps to reproduce the behavior:
-
Load the Example Swagger/OpenAPI definition into editor-next.swagger.io
-
Open the /pi/{x} method and click on "Try it out"
-
Type 127 as parameter x
-
Click "Execute"
-
The URL https://primes.org/pi/127 will be called. Result 31 appears as intented.
-
Open the /π/{x} method (which contains the special char π) and click on "Try it out"
-
Type 127 as parameter x
-
Click "Execute"
-
The URL https://primes.org/π/{x} will be called. Result is bad request. (Correct behaviour should be: The URL https://primes.org/π/127 should be called. Result 31 should appear.)
The problem appears not only in the Swagger Editor(s), also in the normal Swagger UI without editor.