Description
Q&A (please complete the following information)
- OS: macOS
- Browser: chrome
- Version: 123
- Method of installation: npm
- Swagger-UI version: 5.15.2, 5.16.0
- Swagger/OpenAPI version: Swagger 2.0
Content & configuration
Example Swagger/OpenAPI definition:
https://petstore.swagger.io/v2/swagger.json
Swagger-UI configuration options:
SwaggerUI({
url: "https://petstore.swagger.io/v2/swagger.json,
filter: undefined
})
Describe the bug you're encountering
As per the screenshots below, the same OAS 2.0 definition renders correctly in v5.15.2, but fails to render in v5.16.0 (and later versions, all the way up to the current latest v5.17.1).
The only change between the screenshots was updating the SwaggerUI version.
It appears that v5.16.0 treats filter: undefined
differently, by forcing it to be the string value "undefined" (which results in the "No operations defined in spec!" message, as nothing matches that filter.
In v5.15.2 and earlier, an undefined filter was treated as an empty string.
To reproduce...
- In v5.15.2, configure SwaggerUI as shown above and render.
- Update to v5.16.0, and note the difference as per the screenshots.
Expected behavior
Setting filter
to undefined should be treated as though no filter is set (empty string), as it was in previous versions.
Screenshots
Note the main visual differences are:
- In v5.15.2, the filter input is blank and shows the placeholder text "Filter by tag", but in v5.16.0 it is populated with "undefined"
- In v5.15.2, the tags & operations render as expected, but in in v5.16.0 the "No operations defined in spec!" message appears in it's place (but note that the models still render OK)