Q&A (please complete the following information)
This is a regression in the recent 5.1.0 release. The bug does not exist in 5.0.0.
- OS: windows
- Browser: chrome
- Version: 114.0.5735.110 (Official Build) (64-bit)
- Method of installation:
curl -L https://github.com/swagger-api/swagger-ui/archive/refs/tags/v5.1.0.tar.gz | tar xzf -
- Swagger-UI version: 5.1.0
- Swagger/OpenAPI version: OpenAPI 3.1.0
Content & configuration
Example Swagger/OpenAPI definition:
{
"openapi": "3.1.0",
"paths": {
"/pet/{petId}": {
"parameters": [
{
"name": "petId",
"in": "path",
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"get": {
"summary": "Find pet by ID"
}
}
}
}
Swagger-UI configuration options:
window.ui = SwaggerUIBundle({
url: "petstore3.json",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
});
Describe the bug you're encountering

As you can see it says "No parameters" in Swagger UI. However, as you can also see, there is a parameter in the openapi document.
To reproduce...
Steps to reproduce the behavior:
- cd to some directory mounted by a web server. I've tried this with two unrelated webservers, so I don't think it matters which one.
rm -fr swagger-ui-5.1.0
curl -L https://github.com/swagger-api/swagger-ui/archive/refs/tags/v5.1.0.tar.gz | tar xzf -
echo '{"openapi":"3.1.0","paths":{"/pet/{petId}":{"parameters":[{"name":"petId","in":"path","schema":{"type":"integer","format":"int64"}}],"get":{"summary":"FindpetbyID"}}}}' > swagger-ui-5.1.0/dist/petstore3.json
sed -i 's|https://petstore.swagger.io/v2/swagger.json|petstore3.json|' swagger-ui-5.1.0/dist/swagger-initializer.js
- Navigate to
http://...../swagger-ui-5.1.0/dist/ in your web browser
- Click the GET /pet/{petId} Operation
- Witness that it says "No parameters"
Expected behavior

I expect to see the petId parameter.
Additional context or thoughts
My openapi document differs from the vanilla petstore sample in that I have hoisted "parameters" from the GET Operation into its parent Path.
I have discovered 4 different workarounds:
- Refresh the web browser once the address bar ends with
#/default/get_pet__petId_. Suddenly there are parameters!
- Delete the fragment from the address bar to return to the broken behavior.
- Change "openapi" to "3.0.2". Suddenly there are parameters!
- Move the parameter into the GET Operation instead of the Path. Suddenly there are parameters!
- OAS 3.1.0 still allows parameters to be specified in the Path, which is sensible for path parameters, so I don't think I'm doing anything wrong w.r.t. the standard.
- Use swagger-ui v5.0.0. Suddenly there are parameters!
Q&A (please complete the following information)
This is a regression in the recent 5.1.0 release. The bug does not exist in 5.0.0.
curl -L https://github.com/swagger-api/swagger-ui/archive/refs/tags/v5.1.0.tar.gz | tar xzf -Content & configuration
Example Swagger/OpenAPI definition:
{ "openapi": "3.1.0", "paths": { "/pet/{petId}": { "parameters": [ { "name": "petId", "in": "path", "schema": { "type": "integer", "format": "int64" } } ], "get": { "summary": "Find pet by ID" } } } }Swagger-UI configuration options:
Describe the bug you're encountering
As you can see it says "No parameters" in Swagger UI. However, as you can also see, there is a parameter in the openapi document.
To reproduce...
Steps to reproduce the behavior:
rm -fr swagger-ui-5.1.0curl -L https://github.com/swagger-api/swagger-ui/archive/refs/tags/v5.1.0.tar.gz | tar xzf -echo '{"openapi":"3.1.0","paths":{"/pet/{petId}":{"parameters":[{"name":"petId","in":"path","schema":{"type":"integer","format":"int64"}}],"get":{"summary":"FindpetbyID"}}}}' > swagger-ui-5.1.0/dist/petstore3.jsonsed -i 's|https://petstore.swagger.io/v2/swagger.json|petstore3.json|' swagger-ui-5.1.0/dist/swagger-initializer.jshttp://...../swagger-ui-5.1.0/dist/in your web browserExpected behavior
I expect to see the petId parameter.
Additional context or thoughts
My openapi document differs from the vanilla petstore sample in that I have hoisted "parameters" from the GET Operation into its parent Path.
I have discovered 4 different workarounds:
#/default/get_pet__petId_. Suddenly there are parameters!